@keycloakify/angular 21.0.0-rc.2 → 21.0.0-rc.4
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/bin/187.index.js +64 -70
- package/bin/476.index.js +62 -68
- package/bin/{343.index.js → 644.index.js} +2287 -1200
- package/bin/671.index.js +79 -74
- package/bin/942.index.js +62 -68
- package/bin/index.js +12 -9
- package/fesm2022/keycloakify-angular-account-directives-kc-class.mjs +3 -3
- package/fesm2022/keycloakify-angular-account-pages-account.mjs +3 -3
- package/fesm2022/keycloakify-angular-account-pages-applications.mjs +3 -3
- package/fesm2022/keycloakify-angular-account-pages-federatedIdentity.mjs +3 -3
- package/fesm2022/keycloakify-angular-account-pages-log.mjs +3 -3
- package/fesm2022/keycloakify-angular-account-pages-password.mjs +10 -10
- package/fesm2022/keycloakify-angular-account-pages-password.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-account-pages-sessions.mjs +3 -3
- package/fesm2022/keycloakify-angular-account-pages-totp.mjs +3 -3
- package/fesm2022/keycloakify-angular-account-services-account-resource-injector.mjs +3 -3
- package/fesm2022/keycloakify-angular-account-services-i18n.mjs +3 -3
- package/fesm2022/keycloakify-angular-account-template.mjs +4 -4
- package/fesm2022/keycloakify-angular-account-template.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-lib-directives-attributes.mjs +4 -4
- package/fesm2022/keycloakify-angular-lib-directives-attributes.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-lib-pipes-input-type.mjs +3 -3
- package/fesm2022/keycloakify-angular-lib-pipes-is-array-with-empty-object.mjs +3 -3
- package/fesm2022/keycloakify-angular-lib-pipes-kc-sanitize.mjs +3 -3
- package/fesm2022/keycloakify-angular-lib-pipes-to-array.mjs +3 -3
- package/fesm2022/keycloakify-angular-lib-pipes-to-number.mjs +3 -3
- package/fesm2022/keycloakify-angular-lib-services-resource-injector.mjs +3 -3
- package/fesm2022/keycloakify-angular-login-components-add-remove-buttons-multi-valued-attribute.mjs +8 -8
- package/fesm2022/keycloakify-angular-login-components-add-remove-buttons-multi-valued-attribute.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-components-field-errors.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-components-field-errors.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-components-group-label.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-components-group-label.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-components-input-field-by-type.mjs +7 -7
- package/fesm2022/keycloakify-angular-login-components-input-field-by-type.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-components-input-tag-selects.mjs +8 -8
- package/fesm2022/keycloakify-angular-login-components-input-tag-selects.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-components-input-tag.mjs +9 -9
- package/fesm2022/keycloakify-angular-login-components-input-tag.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-components-logout-other-sessions.mjs +3 -3
- package/fesm2022/keycloakify-angular-login-components-password-wrapper.mjs +5 -5
- package/fesm2022/keycloakify-angular-login-components-password-wrapper.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-components-select-tag.mjs +8 -8
- package/fesm2022/keycloakify-angular-login-components-select-tag.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-components-textarea-tag.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-components-textarea-tag.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-components-user-profile-form-fields.mjs +3 -3
- package/fesm2022/keycloakify-angular-login-directives-kc-class.mjs +3 -3
- package/fesm2022/keycloakify-angular-login-pages-code.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-code.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-delete-account-confirm.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-delete-account-confirm.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-delete-credential.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-delete-credential.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-error.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-error.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-frontchannel-logout.mjs +7 -7
- package/fesm2022/keycloakify-angular-login-pages-frontchannel-logout.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-idp-review-user-profile.mjs +7 -7
- package/fesm2022/keycloakify-angular-login-pages-idp-review-user-profile.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-info.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-info.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-config-totp.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-login-config-totp.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-idp-link-confirm-override.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-login-idp-link-confirm-override.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-idp-link-confirm.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-login-idp-link-confirm.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-idp-link-email.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-login-idp-link-email.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-oauth-grant.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-login-oauth-grant.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-oauth2-device-verify-user-code.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-login-oauth2-device-verify-user-code.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-otp.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-login-otp.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-page-expired.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-login-page-expired.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-passkeys-conditional-authenticate.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-login-passkeys-conditional-authenticate.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-password.mjs +7 -7
- package/fesm2022/keycloakify-angular-login-pages-login-password.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-recovery-authn-code-config.mjs +7 -7
- package/fesm2022/keycloakify-angular-login-pages-login-recovery-authn-code-config.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-recovery-authn-code-input.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-login-recovery-authn-code-input.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-reset-otp.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-login-reset-otp.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-reset-password.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-login-reset-password.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-update-password.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-login-update-password.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-update-profile.mjs +7 -7
- package/fesm2022/keycloakify-angular-login-pages-login-update-profile.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-username.mjs +7 -7
- package/fesm2022/keycloakify-angular-login-pages-login-username.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-verify-email.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-login-verify-email.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login-x509-info.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-login-x509-info.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-login.mjs +7 -7
- package/fesm2022/keycloakify-angular-login-pages-login.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-logout-confirm.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-logout-confirm.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-register.mjs +8 -8
- package/fesm2022/keycloakify-angular-login-pages-register.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-saml-post-form.mjs +7 -7
- package/fesm2022/keycloakify-angular-login-pages-saml-post-form.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-select-authenticator.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-select-authenticator.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-terms.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-terms.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-update-email.mjs +7 -7
- package/fesm2022/keycloakify-angular-login-pages-update-email.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-webauthn-authenticate.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-webauthn-authenticate.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-webauthn-error.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-webauthn-error.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-pages-webauthn-register.mjs +6 -6
- package/fesm2022/keycloakify-angular-login-pages-webauthn-register.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-login-services-i18n.mjs +3 -3
- package/fesm2022/keycloakify-angular-login-services-login-resource-injector.mjs +3 -3
- package/fesm2022/keycloakify-angular-login-services-user-profile-form.mjs +3 -3
- package/fesm2022/keycloakify-angular-login-template.mjs +8 -8
- package/fesm2022/keycloakify-angular-login-template.mjs.map +1 -1
- package/package.json +1 -1
- package/src/bin/eject-page.ts +27 -10
- package/src/bin/tools/getThisCodebaseRootDirPath.ts +7 -0
- package/src/bin/tools/nodeModulesBinDirPath.ts +34 -1
- package/src/bin/tools/runPrettier.ts +43 -39
- package/src/bin/tools/readThisNpmPackageVersion.ts +0 -24
|
@@ -60,10 +60,10 @@ class LoginResourceInjectorService {
|
|
|
60
60
|
];
|
|
61
61
|
this.insertAdditionalScripts(scripts);
|
|
62
62
|
}
|
|
63
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
64
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.
|
|
63
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.5", ngImport: i0, type: LoginResourceInjectorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
64
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.5", ngImport: i0, type: LoginResourceInjectorService, providedIn: 'root' }); }
|
|
65
65
|
}
|
|
66
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.5", ngImport: i0, type: LoginResourceInjectorService, decorators: [{
|
|
67
67
|
type: Injectable,
|
|
68
68
|
args: [{
|
|
69
69
|
providedIn: 'root'
|
|
@@ -62,10 +62,10 @@ class UserProfileFormService {
|
|
|
62
62
|
if (this.#unsubscribe)
|
|
63
63
|
this.#unsubscribe();
|
|
64
64
|
}
|
|
65
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
66
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.
|
|
65
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.5", ngImport: i0, type: UserProfileFormService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
66
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.5", ngImport: i0, type: UserProfileFormService, providedIn: 'root' }); }
|
|
67
67
|
}
|
|
68
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
68
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.5", ngImport: i0, type: UserProfileFormService, decorators: [{
|
|
69
69
|
type: Injectable,
|
|
70
70
|
args: [{ providedIn: 'root' }]
|
|
71
71
|
}], ctorParameters: () => [] });
|
|
@@ -30,9 +30,9 @@ class TemplateComponent extends ComponentReference {
|
|
|
30
30
|
this.displayInfo = false;
|
|
31
31
|
this.displayMessage = true;
|
|
32
32
|
this.displayRequiredFields = false;
|
|
33
|
-
this.page = input(
|
|
33
|
+
this.page = input(...(ngDevMode ? [undefined, { debugName: "page" }] : []));
|
|
34
34
|
this.pageRef = viewChild('pageRef', { ...(ngDevMode ? { debugName: "pageRef" } : {}), read: ViewContainerRef });
|
|
35
|
-
this.userProfileFormFields = input(
|
|
35
|
+
this.userProfileFormFields = input(...(ngDevMode ? [undefined, { debugName: "userProfileFormFields" }] : []));
|
|
36
36
|
this.isReadyToRender$ = this.loginResourceInjectorService.injectResource(this.doUseDefaultCss);
|
|
37
37
|
this.#effectRef = effect(() => {
|
|
38
38
|
const page = this.page();
|
|
@@ -86,34 +86,34 @@ class TemplateComponent extends ComponentReference {
|
|
|
86
86
|
this.headerNode = computed(() => {
|
|
87
87
|
const headerNode = compRef.headerNode();
|
|
88
88
|
return headerNode;
|
|
89
|
-
},
|
|
89
|
+
}, ...(ngDevMode ? [{ debugName: "headerNode" }] : []));
|
|
90
90
|
}
|
|
91
91
|
if ('infoNode' in compRef && compRef.infoNode) {
|
|
92
92
|
this.infoNode = computed(() => {
|
|
93
93
|
const infoNode = compRef.infoNode();
|
|
94
94
|
return infoNode;
|
|
95
|
-
},
|
|
95
|
+
}, ...(ngDevMode ? [{ debugName: "infoNode" }] : []));
|
|
96
96
|
}
|
|
97
97
|
if ('socialProvidersNode' in compRef && compRef.socialProvidersNode) {
|
|
98
98
|
this.socialProvidersNode = computed(() => {
|
|
99
99
|
const socialProvidersNode = compRef.socialProvidersNode();
|
|
100
100
|
return socialProvidersNode;
|
|
101
|
-
},
|
|
101
|
+
}, ...(ngDevMode ? [{ debugName: "socialProvidersNode" }] : []));
|
|
102
102
|
}
|
|
103
103
|
this.title.setTitle(this.documentTitle ?? this.i18n.msgStr('loginTitle', this.kcContext.realm.displayName));
|
|
104
104
|
this.applyKcIndexClasses();
|
|
105
105
|
this.#cdr.markForCheck();
|
|
106
106
|
this.#effectRef.destroy();
|
|
107
107
|
}
|
|
108
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
109
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.
|
|
108
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.5", ngImport: i0, type: TemplateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
109
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.5", type: TemplateComponent, isStandalone: true, selector: "kc-root", inputs: { page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, userProfileFormFields: { classPropertyName: "userProfileFormFields", publicName: "userProfileFormFields", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
110
110
|
{
|
|
111
111
|
provide: ComponentReference,
|
|
112
112
|
useExisting: forwardRef(() => TemplateComponent)
|
|
113
113
|
}
|
|
114
114
|
], viewQueries: [{ propertyName: "pageRef", first: true, predicate: ["pageRef"], descendants: true, read: ViewContainerRef, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@let realm = kcContext.realm;\n@let message = kcContext.message;\n@let auth = kcContext.auth;\n@let isAppInitiatedAction = kcContext.isAppInitiatedAction;\n@let url = kcContext.url;\n@let isReadyToRender = isReadyToRender$ | async;\n\n@if (isReadyToRender) {\n <div [kcClass]=\"'kcLoginClass'\">\n <div\n id=\"kc-header\"\n [kcClass]=\"'kcHeaderClass'\"\n >\n <div\n id=\"kc-header-wrapper\"\n [kcClass]=\"'kcHeaderWrapperClass'\"\n >\n <div [innerHTML]=\"realm?.displayNameHtml ?? '' | kcSanitize: 'html'\"></div>\n </div>\n </div>\n\n <div [kcClass]=\"'kcFormCardClass'\">\n <header [kcClass]=\"'kcFormHeaderClass'\">\n <!-- Locale switcher -->\n @if (i18n.enabledLanguages.length > 1) {\n <div\n id=\"kc-locale\"\n [kcClass]=\"'kcLocaleMainClass'\"\n >\n <div\n id=\"kc-locale-wrapper\"\n [kcClass]=\"'kcLocaleWrapperClass'\"\n >\n <div\n id=\"kc-locale-dropdown\"\n class=\"menu-button-links\"\n [kcClass]=\"'kcLocaleDropDownClass'\"\n >\n <button\n tabindex=\"1\"\n id=\"kc-current-locale-link\"\n aria-haspopup=\"true\"\n aria-expanded=\"false\"\n aria-controls=\"language-switch1\"\n [attr.aria-label]=\"i18n.msgStr('languages')\"\n >\n {{ i18n.currentLanguage.label }}\n </button>\n <ul\n role=\"menu\"\n tabindex=\"-1\"\n aria-labelledby=\"kc-current-locale-link\"\n aria-activedescendant=\"\"\n id=\"language-switch1\"\n [kcClass]=\"'kcLocaleListClass'\"\n >\n @for (entry of i18n.enabledLanguages; track entry; let idx = $index) {\n <li\n role=\"none\"\n [kcClass]=\"'kcLocaleListItemClass'\"\n >\n <a\n role=\"menuitem\"\n tabindex=\"-1\"\n [href]=\"entry.href\"\n [kcClass]=\"'kcLocaleItemClass'\"\n [id]=\"'language-' + idx\"\n >\n {{ entry.label }}\n </a>\n </li>\n }\n </ul>\n </div>\n </div>\n </div>\n }\n\n <!-- Header content -->\n <ng-template #node>\n @if (auth && !auth.showUsername && !auth.showResetCredentials) {\n <h1 id=\"kc-page-title\">\n @let header = headerNode && headerNode();\n @if (header) {\n <ng-container [ngTemplateOutlet]=\"header\" />\n }\n </h1>\n } @else {\n <div\n id=\"kc-username\"\n [kcClass]=\"'kcFormGroupClass'\"\n >\n <label id=\"kc-attempted-username\">{{ auth?.attemptedUsername }}</label>\n <a\n id=\"reset-login\"\n [href]=\"url?.loginRestartFlowUrl\"\n [attr.aria-label]=\"i18n.msgStr('restartLoginTooltip')\"\n >\n <div class=\"kc-login-tooltip\">\n <i [kcClass]=\"'kcResetFlowIcon'\"></i>\n <span class=\"kc-tooltip-text\">\n {{ i18n.msgStr('restartLoginTooltip') }}\n </span>\n </div>\n </a>\n </div>\n }\n </ng-template>\n\n @if (displayRequiredFields) {\n <div [kcClass]=\"'kcContentWrapperClass'\">\n <div\n class=\"subtitle\"\n [kcClass]=\"'kcLabelWrapperClass'\"\n >\n <span class=\"subtitle\">\n <span class=\"required\">*</span>\n {{ i18n.msgStr('requiredFields') }}\n </span>\n </div>\n <div class=\"col-md-10\">\n <ng-container [ngTemplateOutlet]=\"node\" />\n </div>\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"node\" />\n }\n </header>\n\n <div id=\"kc-content\">\n <div id=\"kc-content-wrapper\">\n <!-- Message display -->\n @if (displayMessage && message && (message.type !== 'warning' || !isAppInitiatedAction)) {\n <div\n [kcClass]=\"'kcAlertClass'\"\n [ngClass]=\"message.type === 'error' ? 'pf-m-danger' : 'pf-m-' + message.type\"\n [class]=\"'alert-' + message.type\"\n >\n <div class=\"pf-c-alert__icon\">\n @switch (message.type) {\n @case ('success') {\n <span [kcClass]=\"'kcFeedbackSuccessIcon'\"></span>\n }\n @case ('warning') {\n <span [kcClass]=\"'kcFeedbackWarningIcon'\"></span>\n }\n @case ('info') {\n <span [kcClass]=\"'kcFeedbackInfoIcon'\"></span>\n }\n @case ('error') {\n <span [kcClass]=\"'kcFeedbackErrorIcon'\"></span>\n }\n }\n </div>\n <span\n [kcClass]=\"'kcAlertTitleClass'\"\n [innerHTML]=\"message.summary | kcSanitize: 'html'\"\n ></span>\n </div>\n }\n <!-- Content -->\n <ng-template #pageRef></ng-template>\n\n @if (!!auth && auth?.showTryAnotherWayLink) {\n <form\n id=\"kc-select-try-another-way-form\"\n method=\"post\"\n [action]=\"url?.loginAction\"\n >\n <div [kcClass]=\"'kcFormGroupClass'\">\n <div [kcClass]=\"'kcFormGroupClass'\">\n <input\n type=\"hidden\"\n name=\"tryAnotherWay\"\n value=\"on\"\n />\n <a\n id=\"try-another-way\"\n (click)=\"tryAnotherWay()\"\n >\n {{ i18n.msgStr('doTryAnotherWay') }}\n </a>\n </div>\n </div>\n </form>\n }\n @let socialProviders = socialProvidersNode && socialProvidersNode();\n @if (socialProviders) {\n <ng-container [ngTemplateOutlet]=\"socialProviders\" />\n }\n <!-- Info display -->\n @if (displayInfo) {\n <div\n id=\"kc-info\"\n [kcClass]=\"'kcSignUpClass'\"\n >\n <div\n id=\"kc-info-wrapper\"\n [kcClass]=\"'kcInfoAreaWrapperClass'\"\n >\n @let info = infoNode && infoNode();\n @if (info) {\n <ng-container [ngTemplateOutlet]=\"info\" />\n }\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: KcClassDirective, selector: "[kcClass]", inputs: ["class", "ngClass", "kcClass"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: KcSanitizePipe, name: "kcSanitize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
115
115
|
}
|
|
116
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.5", ngImport: i0, type: TemplateComponent, decorators: [{
|
|
117
117
|
type: Component,
|
|
118
118
|
args: [{ selector: 'kc-root', imports: [AsyncPipe, KcSanitizePipe, NgTemplateOutlet, KcClassDirective], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
119
119
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keycloakify-angular-login-template.mjs","sources":["../../src/login/template/template.component.ts","../../src/login/template/template.component.html","../../src/login/template/keycloakify-angular-login-template.ts"],"sourcesContent":["import { AsyncPipe, NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n computed,\n effect,\n type EffectRef,\n forwardRef,\n inject,\n input,\n Renderer2,\n type Signal,\n type TemplateRef,\n type Type,\n viewChild,\n ViewContainerRef\n} from '@angular/core';\nimport { Meta, Title } from '@angular/platform-browser';\nimport { KcSanitizePipe } from '@keycloakify/angular/lib/pipes/kc-sanitize';\nimport { USE_DEFAULT_CSS } from '@keycloakify/angular/lib/tokens/use-default-css';\nimport { ComponentReference } from '@keycloakify/angular/login/classes/component-reference';\nimport { KcClassDirective } from '@keycloakify/angular/login/directives/kc-class';\nimport type { I18n } from '@keycloakify/angular/login/i18n';\nimport { type KcContext } from '@keycloakify/angular/login/KcContext';\nimport { LoginResourceInjectorService } from '@keycloakify/angular/login/services/login-resource-injector';\nimport { LOGIN_CLASSES } from '@keycloakify/angular/login/tokens/classes';\nimport { LOGIN_I18N } from '@keycloakify/angular/login/tokens/i18n';\nimport { KC_LOGIN_CONTEXT } from '@keycloakify/angular/login/tokens/kc-context';\nimport { type ClassKey, getKcClsx } from 'keycloakify/login/lib/kcClsx';\nimport type { Observable } from 'rxjs';\n\n@Component({\n selector: 'kc-root',\n templateUrl: 'template.component.html',\n imports: [AsyncPipe, KcSanitizePipe, NgTemplateOutlet, KcClassDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: ComponentReference,\n useExisting: forwardRef(() => TemplateComponent)\n }\n ]\n})\nexport class TemplateComponent extends ComponentReference {\n i18n = inject<I18n>(LOGIN_I18N);\n renderer = inject(Renderer2);\n #cdr = inject(ChangeDetectorRef);\n #effectRef: EffectRef;\n meta = inject(Meta);\n title = inject(Title);\n kcContext = inject<KcContext>(KC_LOGIN_CONTEXT);\n override doUseDefaultCss = inject<boolean>(USE_DEFAULT_CSS);\n override classes = inject<Partial<Record<ClassKey, string>>>(LOGIN_CLASSES);\n loginResourceInjectorService = inject(LoginResourceInjectorService);\n\n displayInfo = false;\n displayMessage = true;\n displayRequiredFields = false;\n documentTitle: string | undefined;\n bodyClassName: string | undefined;\n\n isReadyToRender$: Observable<boolean>;\n\n page = input<Type<unknown>>();\n pageRef = viewChild('pageRef', { read: ViewContainerRef });\n\n userProfileFormFields = input<Type<unknown>>();\n headerNode: Signal<TemplateRef<HTMLElement>> | undefined;\n infoNode: Signal<TemplateRef<HTMLElement>> | undefined;\n socialProvidersNode: Signal<TemplateRef<HTMLElement>> | undefined;\n\n constructor() {\n super();\n\n this.isReadyToRender$ = this.loginResourceInjectorService.injectResource(this.doUseDefaultCss);\n this.#effectRef = effect(\n () => {\n const page = this.page();\n const pageRef = this.pageRef();\n if (!page || !pageRef) return;\n\n const userProfileFormFields = this.userProfileFormFields();\n\n const compRef = pageRef.createComponent(page);\n if ('userProfileFormFields' in (compRef.instance as object) && userProfileFormFields) {\n compRef.setInput('userProfileFormFields', userProfileFormFields);\n }\n this.onComponentCreated(compRef.instance as object);\n },\n { manualCleanup: true }\n );\n }\n\n private applyKcIndexClasses() {\n const kcClsx = getKcClsx({\n doUseDefaultCss: this.doUseDefaultCss,\n classes: this.classes\n }).kcClsx;\n const kcBodyClass = this.bodyClassName ?? kcClsx('kcBodyClass');\n const kcHtmlClass = kcClsx('kcHtmlClass');\n const kcBodyClasses = kcBodyClass.split(/\\s+/);\n const kcHtmlClasses = kcHtmlClass.split(/\\s+/);\n kcBodyClasses.forEach(klass => {\n this.renderer.addClass(document.body, klass);\n });\n kcHtmlClasses.forEach(klass => {\n this.renderer.addClass(document.documentElement, klass);\n });\n }\n\n tryAnotherWay() {\n document.forms['kc-select-try-another-way-form' as never].requestSubmit();\n }\n\n onComponentCreated(compRef: object) {\n if ('displayInfo' in compRef) {\n this.displayInfo = !!compRef.displayInfo as boolean;\n }\n if ('displayMessage' in compRef) {\n this.displayMessage = !!compRef.displayMessage as boolean;\n }\n if ('displayRequiredFields' in compRef) {\n this.displayRequiredFields = !!compRef.displayRequiredFields as boolean;\n }\n if ('documentTitle' in compRef && compRef.documentTitle) {\n this.documentTitle = compRef.documentTitle as string;\n }\n if ('bodyClassName' in compRef && compRef.bodyClassName) {\n this.bodyClassName = compRef.bodyClassName as string;\n }\n if ('headerNode' in compRef && compRef.headerNode) {\n this.headerNode = computed(() => {\n const headerNode = (compRef.headerNode as Signal<TemplateRef<HTMLElement>>)();\n return headerNode;\n });\n }\n if ('infoNode' in compRef && compRef.infoNode) {\n this.infoNode = computed(() => {\n const infoNode = (compRef.infoNode as Signal<TemplateRef<HTMLElement>>)();\n return infoNode;\n });\n }\n if ('socialProvidersNode' in compRef && compRef.socialProvidersNode) {\n this.socialProvidersNode = computed(() => {\n const socialProvidersNode = (compRef.socialProvidersNode as Signal<TemplateRef<HTMLElement>>)();\n return socialProvidersNode;\n });\n }\n this.title.setTitle(this.documentTitle ?? this.i18n.msgStr('loginTitle', this.kcContext.realm.displayName));\n this.applyKcIndexClasses();\n this.#cdr.markForCheck();\n this.#effectRef.destroy();\n }\n}\n","@let realm = kcContext.realm;\n@let message = kcContext.message;\n@let auth = kcContext.auth;\n@let isAppInitiatedAction = kcContext.isAppInitiatedAction;\n@let url = kcContext.url;\n@let isReadyToRender = isReadyToRender$ | async;\n\n@if (isReadyToRender) {\n <div [kcClass]=\"'kcLoginClass'\">\n <div\n id=\"kc-header\"\n [kcClass]=\"'kcHeaderClass'\"\n >\n <div\n id=\"kc-header-wrapper\"\n [kcClass]=\"'kcHeaderWrapperClass'\"\n >\n <div [innerHTML]=\"realm?.displayNameHtml ?? '' | kcSanitize: 'html'\"></div>\n </div>\n </div>\n\n <div [kcClass]=\"'kcFormCardClass'\">\n <header [kcClass]=\"'kcFormHeaderClass'\">\n <!-- Locale switcher -->\n @if (i18n.enabledLanguages.length > 1) {\n <div\n id=\"kc-locale\"\n [kcClass]=\"'kcLocaleMainClass'\"\n >\n <div\n id=\"kc-locale-wrapper\"\n [kcClass]=\"'kcLocaleWrapperClass'\"\n >\n <div\n id=\"kc-locale-dropdown\"\n class=\"menu-button-links\"\n [kcClass]=\"'kcLocaleDropDownClass'\"\n >\n <button\n tabindex=\"1\"\n id=\"kc-current-locale-link\"\n aria-haspopup=\"true\"\n aria-expanded=\"false\"\n aria-controls=\"language-switch1\"\n [attr.aria-label]=\"i18n.msgStr('languages')\"\n >\n {{ i18n.currentLanguage.label }}\n </button>\n <ul\n role=\"menu\"\n tabindex=\"-1\"\n aria-labelledby=\"kc-current-locale-link\"\n aria-activedescendant=\"\"\n id=\"language-switch1\"\n [kcClass]=\"'kcLocaleListClass'\"\n >\n @for (entry of i18n.enabledLanguages; track entry; let idx = $index) {\n <li\n role=\"none\"\n [kcClass]=\"'kcLocaleListItemClass'\"\n >\n <a\n role=\"menuitem\"\n tabindex=\"-1\"\n [href]=\"entry.href\"\n [kcClass]=\"'kcLocaleItemClass'\"\n [id]=\"'language-' + idx\"\n >\n {{ entry.label }}\n </a>\n </li>\n }\n </ul>\n </div>\n </div>\n </div>\n }\n\n <!-- Header content -->\n <ng-template #node>\n @if (auth && !auth.showUsername && !auth.showResetCredentials) {\n <h1 id=\"kc-page-title\">\n @let header = headerNode && headerNode();\n @if (header) {\n <ng-container [ngTemplateOutlet]=\"header\" />\n }\n </h1>\n } @else {\n <div\n id=\"kc-username\"\n [kcClass]=\"'kcFormGroupClass'\"\n >\n <label id=\"kc-attempted-username\">{{ auth?.attemptedUsername }}</label>\n <a\n id=\"reset-login\"\n [href]=\"url?.loginRestartFlowUrl\"\n [attr.aria-label]=\"i18n.msgStr('restartLoginTooltip')\"\n >\n <div class=\"kc-login-tooltip\">\n <i [kcClass]=\"'kcResetFlowIcon'\"></i>\n <span class=\"kc-tooltip-text\">\n {{ i18n.msgStr('restartLoginTooltip') }}\n </span>\n </div>\n </a>\n </div>\n }\n </ng-template>\n\n @if (displayRequiredFields) {\n <div [kcClass]=\"'kcContentWrapperClass'\">\n <div\n class=\"subtitle\"\n [kcClass]=\"'kcLabelWrapperClass'\"\n >\n <span class=\"subtitle\">\n <span class=\"required\">*</span>\n {{ i18n.msgStr('requiredFields') }}\n </span>\n </div>\n <div class=\"col-md-10\">\n <ng-container [ngTemplateOutlet]=\"node\" />\n </div>\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"node\" />\n }\n </header>\n\n <div id=\"kc-content\">\n <div id=\"kc-content-wrapper\">\n <!-- Message display -->\n @if (displayMessage && message && (message.type !== 'warning' || !isAppInitiatedAction)) {\n <div\n [kcClass]=\"'kcAlertClass'\"\n [ngClass]=\"message.type === 'error' ? 'pf-m-danger' : 'pf-m-' + message.type\"\n [class]=\"'alert-' + message.type\"\n >\n <div class=\"pf-c-alert__icon\">\n @switch (message.type) {\n @case ('success') {\n <span [kcClass]=\"'kcFeedbackSuccessIcon'\"></span>\n }\n @case ('warning') {\n <span [kcClass]=\"'kcFeedbackWarningIcon'\"></span>\n }\n @case ('info') {\n <span [kcClass]=\"'kcFeedbackInfoIcon'\"></span>\n }\n @case ('error') {\n <span [kcClass]=\"'kcFeedbackErrorIcon'\"></span>\n }\n }\n </div>\n <span\n [kcClass]=\"'kcAlertTitleClass'\"\n [innerHTML]=\"message.summary | kcSanitize: 'html'\"\n ></span>\n </div>\n }\n <!-- Content -->\n <ng-template #pageRef></ng-template>\n\n @if (!!auth && auth?.showTryAnotherWayLink) {\n <form\n id=\"kc-select-try-another-way-form\"\n method=\"post\"\n [action]=\"url?.loginAction\"\n >\n <div [kcClass]=\"'kcFormGroupClass'\">\n <div [kcClass]=\"'kcFormGroupClass'\">\n <input\n type=\"hidden\"\n name=\"tryAnotherWay\"\n value=\"on\"\n />\n <a\n id=\"try-another-way\"\n (click)=\"tryAnotherWay()\"\n >\n {{ i18n.msgStr('doTryAnotherWay') }}\n </a>\n </div>\n </div>\n </form>\n }\n @let socialProviders = socialProvidersNode && socialProvidersNode();\n @if (socialProviders) {\n <ng-container [ngTemplateOutlet]=\"socialProviders\" />\n }\n <!-- Info display -->\n @if (displayInfo) {\n <div\n id=\"kc-info\"\n [kcClass]=\"'kcSignUpClass'\"\n >\n <div\n id=\"kc-info-wrapper\"\n [kcClass]=\"'kcInfoAreaWrapperClass'\"\n >\n @let info = infoNode && infoNode();\n @if (info) {\n <ng-container [ngTemplateOutlet]=\"info\" />\n }\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AA4CM,MAAO,iBAAkB,SAAQ,kBAAkB,CAAA;AAGrD,IAAA,IAAI;AACJ,IAAA,UAAU;AAwBV,IAAA,WAAA,GAAA;AACI,QAAA,KAAK,EAAE;AA5BX,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAO,UAAU,CAAC;AAC/B,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;AAC5B,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAEhC,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;AACnB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AACrB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAY,gBAAgB,CAAC;AACtC,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAU,eAAe,CAAC;AAClD,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAoC,aAAa,CAAC;AAC3E,QAAA,IAAA,CAAA,4BAA4B,GAAG,MAAM,CAAC,4BAA4B,CAAC;QAEnE,IAAA,CAAA,WAAW,GAAG,KAAK;QACnB,IAAA,CAAA,cAAc,GAAG,IAAI;QACrB,IAAA,CAAA,qBAAqB,GAAG,KAAK;QAM7B,IAAA,CAAA,IAAI,GAAG,KAAK,CAAA,SAAA,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,MAAA,EAAA,GAAA,EAAA,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AAA,UAAA,EAAA,CAAA;kBAZ7B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,SAAS,EAAA,OAAA,EAEV,CAAC,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,EAAA,eAAA,EACvD,uBAAuB,CAAC,MAAM,EAAA,SAAA,EACpC;AACP,wBAAA;AACI,4BAAA,OAAO,EAAE,kBAAkB;AAC3B,4BAAA,WAAW,EAAE,UAAU,CAAC,uBAAuB;AAClD;AACJ,qBAAA,EAAA,QAAA,EAAA,u5TAAA,EAAA;AAuBmB,SAAA,CAAA,EAAA,cAAA,EAAA,MAAA,EAAA,EAAA,cAAA,EAAA,EAAA,IAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,MAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,SAAS,EAAA,EAAA,GAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,qBAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEjE7D;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"keycloakify-angular-login-template.mjs","sources":["../../src/login/template/template.component.ts","../../src/login/template/template.component.html","../../src/login/template/keycloakify-angular-login-template.ts"],"sourcesContent":["import { AsyncPipe, NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n computed,\n effect,\n type EffectRef,\n forwardRef,\n inject,\n input,\n Renderer2,\n type Signal,\n type TemplateRef,\n type Type,\n viewChild,\n ViewContainerRef\n} from '@angular/core';\nimport { Meta, Title } from '@angular/platform-browser';\nimport { KcSanitizePipe } from '@keycloakify/angular/lib/pipes/kc-sanitize';\nimport { USE_DEFAULT_CSS } from '@keycloakify/angular/lib/tokens/use-default-css';\nimport { ComponentReference } from '@keycloakify/angular/login/classes/component-reference';\nimport { KcClassDirective } from '@keycloakify/angular/login/directives/kc-class';\nimport type { I18n } from '@keycloakify/angular/login/i18n';\nimport { type KcContext } from '@keycloakify/angular/login/KcContext';\nimport { LoginResourceInjectorService } from '@keycloakify/angular/login/services/login-resource-injector';\nimport { LOGIN_CLASSES } from '@keycloakify/angular/login/tokens/classes';\nimport { LOGIN_I18N } from '@keycloakify/angular/login/tokens/i18n';\nimport { KC_LOGIN_CONTEXT } from '@keycloakify/angular/login/tokens/kc-context';\nimport { type ClassKey, getKcClsx } from 'keycloakify/login/lib/kcClsx';\nimport type { Observable } from 'rxjs';\n\n@Component({\n selector: 'kc-root',\n templateUrl: 'template.component.html',\n imports: [AsyncPipe, KcSanitizePipe, NgTemplateOutlet, KcClassDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: ComponentReference,\n useExisting: forwardRef(() => TemplateComponent)\n }\n ]\n})\nexport class TemplateComponent extends ComponentReference {\n i18n = inject<I18n>(LOGIN_I18N);\n renderer = inject(Renderer2);\n #cdr = inject(ChangeDetectorRef);\n #effectRef: EffectRef;\n meta = inject(Meta);\n title = inject(Title);\n kcContext = inject<KcContext>(KC_LOGIN_CONTEXT);\n override doUseDefaultCss = inject<boolean>(USE_DEFAULT_CSS);\n override classes = inject<Partial<Record<ClassKey, string>>>(LOGIN_CLASSES);\n loginResourceInjectorService = inject(LoginResourceInjectorService);\n\n displayInfo = false;\n displayMessage = true;\n displayRequiredFields = false;\n documentTitle: string | undefined;\n bodyClassName: string | undefined;\n\n isReadyToRender$: Observable<boolean>;\n\n page = input<Type<unknown>>();\n pageRef = viewChild('pageRef', { read: ViewContainerRef });\n\n userProfileFormFields = input<Type<unknown>>();\n headerNode: Signal<TemplateRef<HTMLElement>> | undefined;\n infoNode: Signal<TemplateRef<HTMLElement>> | undefined;\n socialProvidersNode: Signal<TemplateRef<HTMLElement>> | undefined;\n\n constructor() {\n super();\n\n this.isReadyToRender$ = this.loginResourceInjectorService.injectResource(this.doUseDefaultCss);\n this.#effectRef = effect(\n () => {\n const page = this.page();\n const pageRef = this.pageRef();\n if (!page || !pageRef) return;\n\n const userProfileFormFields = this.userProfileFormFields();\n\n const compRef = pageRef.createComponent(page);\n if ('userProfileFormFields' in (compRef.instance as object) && userProfileFormFields) {\n compRef.setInput('userProfileFormFields', userProfileFormFields);\n }\n this.onComponentCreated(compRef.instance as object);\n },\n { manualCleanup: true }\n );\n }\n\n private applyKcIndexClasses() {\n const kcClsx = getKcClsx({\n doUseDefaultCss: this.doUseDefaultCss,\n classes: this.classes\n }).kcClsx;\n const kcBodyClass = this.bodyClassName ?? kcClsx('kcBodyClass');\n const kcHtmlClass = kcClsx('kcHtmlClass');\n const kcBodyClasses = kcBodyClass.split(/\\s+/);\n const kcHtmlClasses = kcHtmlClass.split(/\\s+/);\n kcBodyClasses.forEach(klass => {\n this.renderer.addClass(document.body, klass);\n });\n kcHtmlClasses.forEach(klass => {\n this.renderer.addClass(document.documentElement, klass);\n });\n }\n\n tryAnotherWay() {\n document.forms['kc-select-try-another-way-form' as never].requestSubmit();\n }\n\n onComponentCreated(compRef: object) {\n if ('displayInfo' in compRef) {\n this.displayInfo = !!compRef.displayInfo as boolean;\n }\n if ('displayMessage' in compRef) {\n this.displayMessage = !!compRef.displayMessage as boolean;\n }\n if ('displayRequiredFields' in compRef) {\n this.displayRequiredFields = !!compRef.displayRequiredFields as boolean;\n }\n if ('documentTitle' in compRef && compRef.documentTitle) {\n this.documentTitle = compRef.documentTitle as string;\n }\n if ('bodyClassName' in compRef && compRef.bodyClassName) {\n this.bodyClassName = compRef.bodyClassName as string;\n }\n if ('headerNode' in compRef && compRef.headerNode) {\n this.headerNode = computed(() => {\n const headerNode = (compRef.headerNode as Signal<TemplateRef<HTMLElement>>)();\n return headerNode;\n });\n }\n if ('infoNode' in compRef && compRef.infoNode) {\n this.infoNode = computed(() => {\n const infoNode = (compRef.infoNode as Signal<TemplateRef<HTMLElement>>)();\n return infoNode;\n });\n }\n if ('socialProvidersNode' in compRef && compRef.socialProvidersNode) {\n this.socialProvidersNode = computed(() => {\n const socialProvidersNode = (compRef.socialProvidersNode as Signal<TemplateRef<HTMLElement>>)();\n return socialProvidersNode;\n });\n }\n this.title.setTitle(this.documentTitle ?? this.i18n.msgStr('loginTitle', this.kcContext.realm.displayName));\n this.applyKcIndexClasses();\n this.#cdr.markForCheck();\n this.#effectRef.destroy();\n }\n}\n","@let realm = kcContext.realm;\n@let message = kcContext.message;\n@let auth = kcContext.auth;\n@let isAppInitiatedAction = kcContext.isAppInitiatedAction;\n@let url = kcContext.url;\n@let isReadyToRender = isReadyToRender$ | async;\n\n@if (isReadyToRender) {\n <div [kcClass]=\"'kcLoginClass'\">\n <div\n id=\"kc-header\"\n [kcClass]=\"'kcHeaderClass'\"\n >\n <div\n id=\"kc-header-wrapper\"\n [kcClass]=\"'kcHeaderWrapperClass'\"\n >\n <div [innerHTML]=\"realm?.displayNameHtml ?? '' | kcSanitize: 'html'\"></div>\n </div>\n </div>\n\n <div [kcClass]=\"'kcFormCardClass'\">\n <header [kcClass]=\"'kcFormHeaderClass'\">\n <!-- Locale switcher -->\n @if (i18n.enabledLanguages.length > 1) {\n <div\n id=\"kc-locale\"\n [kcClass]=\"'kcLocaleMainClass'\"\n >\n <div\n id=\"kc-locale-wrapper\"\n [kcClass]=\"'kcLocaleWrapperClass'\"\n >\n <div\n id=\"kc-locale-dropdown\"\n class=\"menu-button-links\"\n [kcClass]=\"'kcLocaleDropDownClass'\"\n >\n <button\n tabindex=\"1\"\n id=\"kc-current-locale-link\"\n aria-haspopup=\"true\"\n aria-expanded=\"false\"\n aria-controls=\"language-switch1\"\n [attr.aria-label]=\"i18n.msgStr('languages')\"\n >\n {{ i18n.currentLanguage.label }}\n </button>\n <ul\n role=\"menu\"\n tabindex=\"-1\"\n aria-labelledby=\"kc-current-locale-link\"\n aria-activedescendant=\"\"\n id=\"language-switch1\"\n [kcClass]=\"'kcLocaleListClass'\"\n >\n @for (entry of i18n.enabledLanguages; track entry; let idx = $index) {\n <li\n role=\"none\"\n [kcClass]=\"'kcLocaleListItemClass'\"\n >\n <a\n role=\"menuitem\"\n tabindex=\"-1\"\n [href]=\"entry.href\"\n [kcClass]=\"'kcLocaleItemClass'\"\n [id]=\"'language-' + idx\"\n >\n {{ entry.label }}\n </a>\n </li>\n }\n </ul>\n </div>\n </div>\n </div>\n }\n\n <!-- Header content -->\n <ng-template #node>\n @if (auth && !auth.showUsername && !auth.showResetCredentials) {\n <h1 id=\"kc-page-title\">\n @let header = headerNode && headerNode();\n @if (header) {\n <ng-container [ngTemplateOutlet]=\"header\" />\n }\n </h1>\n } @else {\n <div\n id=\"kc-username\"\n [kcClass]=\"'kcFormGroupClass'\"\n >\n <label id=\"kc-attempted-username\">{{ auth?.attemptedUsername }}</label>\n <a\n id=\"reset-login\"\n [href]=\"url?.loginRestartFlowUrl\"\n [attr.aria-label]=\"i18n.msgStr('restartLoginTooltip')\"\n >\n <div class=\"kc-login-tooltip\">\n <i [kcClass]=\"'kcResetFlowIcon'\"></i>\n <span class=\"kc-tooltip-text\">\n {{ i18n.msgStr('restartLoginTooltip') }}\n </span>\n </div>\n </a>\n </div>\n }\n </ng-template>\n\n @if (displayRequiredFields) {\n <div [kcClass]=\"'kcContentWrapperClass'\">\n <div\n class=\"subtitle\"\n [kcClass]=\"'kcLabelWrapperClass'\"\n >\n <span class=\"subtitle\">\n <span class=\"required\">*</span>\n {{ i18n.msgStr('requiredFields') }}\n </span>\n </div>\n <div class=\"col-md-10\">\n <ng-container [ngTemplateOutlet]=\"node\" />\n </div>\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"node\" />\n }\n </header>\n\n <div id=\"kc-content\">\n <div id=\"kc-content-wrapper\">\n <!-- Message display -->\n @if (displayMessage && message && (message.type !== 'warning' || !isAppInitiatedAction)) {\n <div\n [kcClass]=\"'kcAlertClass'\"\n [ngClass]=\"message.type === 'error' ? 'pf-m-danger' : 'pf-m-' + message.type\"\n [class]=\"'alert-' + message.type\"\n >\n <div class=\"pf-c-alert__icon\">\n @switch (message.type) {\n @case ('success') {\n <span [kcClass]=\"'kcFeedbackSuccessIcon'\"></span>\n }\n @case ('warning') {\n <span [kcClass]=\"'kcFeedbackWarningIcon'\"></span>\n }\n @case ('info') {\n <span [kcClass]=\"'kcFeedbackInfoIcon'\"></span>\n }\n @case ('error') {\n <span [kcClass]=\"'kcFeedbackErrorIcon'\"></span>\n }\n }\n </div>\n <span\n [kcClass]=\"'kcAlertTitleClass'\"\n [innerHTML]=\"message.summary | kcSanitize: 'html'\"\n ></span>\n </div>\n }\n <!-- Content -->\n <ng-template #pageRef></ng-template>\n\n @if (!!auth && auth?.showTryAnotherWayLink) {\n <form\n id=\"kc-select-try-another-way-form\"\n method=\"post\"\n [action]=\"url?.loginAction\"\n >\n <div [kcClass]=\"'kcFormGroupClass'\">\n <div [kcClass]=\"'kcFormGroupClass'\">\n <input\n type=\"hidden\"\n name=\"tryAnotherWay\"\n value=\"on\"\n />\n <a\n id=\"try-another-way\"\n (click)=\"tryAnotherWay()\"\n >\n {{ i18n.msgStr('doTryAnotherWay') }}\n </a>\n </div>\n </div>\n </form>\n }\n @let socialProviders = socialProvidersNode && socialProvidersNode();\n @if (socialProviders) {\n <ng-container [ngTemplateOutlet]=\"socialProviders\" />\n }\n <!-- Info display -->\n @if (displayInfo) {\n <div\n id=\"kc-info\"\n [kcClass]=\"'kcSignUpClass'\"\n >\n <div\n id=\"kc-info-wrapper\"\n [kcClass]=\"'kcInfoAreaWrapperClass'\"\n >\n @let info = infoNode && infoNode();\n @if (info) {\n <ng-container [ngTemplateOutlet]=\"info\" />\n }\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AA4CM,MAAO,iBAAkB,SAAQ,kBAAkB,CAAA;AAGrD,IAAA,IAAI;AACJ,IAAA,UAAU;AAwBV,IAAA,WAAA,GAAA;AACI,QAAA,KAAK,EAAE;AA5BX,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAO,UAAU,CAAC;AAC/B,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;AAC5B,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAEhC,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;AACnB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AACrB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAY,gBAAgB,CAAC;AACtC,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAU,eAAe,CAAC;AAClD,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAoC,aAAa,CAAC;AAC3E,QAAA,IAAA,CAAA,4BAA4B,GAAG,MAAM,CAAC,4BAA4B,CAAC;QAEnE,IAAA,CAAA,WAAW,GAAG,KAAK;QACnB,IAAA,CAAA,cAAc,GAAG,IAAI;QACrB,IAAA,CAAA,qBAAqB,GAAG,KAAK;QAM7B,IAAA,CAAA,IAAI,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAiB;QAC7B,IAAA,CAAA,OAAO,GAAG,SAAS,CAAC,SAAS,oDAAI,IAAI,EAAE,gBAAgB,EAAA,CAAG;QAE1D,IAAA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,EAAE,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,EAAA,eAAA,EACvD,uBAAuB,CAAC,MAAM,EAAA,SAAA,EACpC;AACP,wBAAA;AACI,4BAAA,OAAO,EAAE,kBAAkB;AAC3B,4BAAA,WAAW,EAAE,UAAU,CAAC,uBAAuB;AAClD;AACJ,qBAAA,EAAA,QAAA,EAAA,u5TAAA,EAAA;AAuBmB,SAAA,CAAA,EAAA,cAAA,EAAA,MAAA,EAAA,EAAA,cAAA,EAAA,EAAA,IAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,MAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,SAAS,EAAA,EAAA,GAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,qBAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEjE7D;;AAEG;;;;"}
|
package/package.json
CHANGED
package/src/bin/eject-page.ts
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
posix as pathPosix,
|
|
21
21
|
basename as pathBase
|
|
22
22
|
} from 'path';
|
|
23
|
-
import { assert, Equals } from 'tsafe/assert';
|
|
23
|
+
import { assert, type Equals } from 'tsafe/assert';
|
|
24
24
|
import chalk from 'chalk';
|
|
25
25
|
import { transformCodebase } from './tools/transformCodebase_async';
|
|
26
26
|
import { kebabCaseToCamelCase } from './tools/kebabCaseToSnakeCase';
|
|
@@ -129,6 +129,8 @@ export async function command(params: { buildContext: BuildContext }) {
|
|
|
129
129
|
return pathJoin('pages', pageIdOrComponent.replace(/\.ftl$/, ''));
|
|
130
130
|
})();
|
|
131
131
|
|
|
132
|
+
let hasEjectedUserProfileFormFieldsComponent = false;
|
|
133
|
+
|
|
132
134
|
{
|
|
133
135
|
const componentDirRelativeToThemeTypePaths = [
|
|
134
136
|
componentDirRelativeToThemeTypePath
|
|
@@ -140,6 +142,13 @@ export async function command(params: { buildContext: BuildContext }) {
|
|
|
140
142
|
|
|
141
143
|
assert(componentDirRelativeToThemeTypePath_i !== undefined);
|
|
142
144
|
|
|
145
|
+
if (
|
|
146
|
+
componentDirRelativeToThemeTypePath_i ===
|
|
147
|
+
pathJoin('components', 'user-profile-form-fields')
|
|
148
|
+
) {
|
|
149
|
+
hasEjectedUserProfileFormFieldsComponent = true;
|
|
150
|
+
}
|
|
151
|
+
|
|
143
152
|
const destDirPath = pathJoin(
|
|
144
153
|
buildContext.themeSrcDirPath,
|
|
145
154
|
themeType,
|
|
@@ -301,16 +310,28 @@ export async function command(params: { buildContext: BuildContext }) {
|
|
|
301
310
|
}
|
|
302
311
|
|
|
303
312
|
edit_KcFiles: {
|
|
304
|
-
|
|
305
|
-
pageIdOrComponent
|
|
306
|
-
|
|
307
|
-
|
|
313
|
+
const componentRelativeDirPath_posix = (() => {
|
|
314
|
+
if (pageIdOrComponent === templateValue) {
|
|
315
|
+
return 'template';
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
if (
|
|
319
|
+
pageIdOrComponent === userProfileFormFieldsValue ||
|
|
320
|
+
hasEjectedUserProfileFormFieldsComponent
|
|
321
|
+
) {
|
|
322
|
+
return 'components/user-profile-form-fields';
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
return undefined;
|
|
326
|
+
})();
|
|
327
|
+
|
|
328
|
+
if (componentRelativeDirPath_posix === undefined) {
|
|
308
329
|
break edit_KcFiles;
|
|
309
330
|
}
|
|
310
331
|
|
|
311
332
|
const filesToProcess = ['KcPage.ts', 'KcPageStory.ts'];
|
|
312
333
|
|
|
313
|
-
for (
|
|
334
|
+
for (const fileName of filesToProcess) {
|
|
314
335
|
const filePath = pathJoin(buildContext.themeSrcDirPath, themeType, fileName);
|
|
315
336
|
|
|
316
337
|
if (!fs.existsSync(filePath)) {
|
|
@@ -321,10 +342,6 @@ export async function command(params: { buildContext: BuildContext }) {
|
|
|
321
342
|
const originalCode = fs.readFileSync(filePath).toString('utf8');
|
|
322
343
|
|
|
323
344
|
const modifiedCode = await (async () => {
|
|
324
|
-
const componentRelativeDirPath_posix = componentDirRelativeToThemeTypePath
|
|
325
|
-
.split(pathSep)
|
|
326
|
-
.join('/');
|
|
327
|
-
|
|
328
345
|
let sourceCode = originalCode.replace(
|
|
329
346
|
`@keycloakify/angular/${themeType}/${componentRelativeDirPath_posix}`,
|
|
330
347
|
componentRelativeDirPath_posix_to_componentRelativeFilePath_posix({
|
|
@@ -20,3 +20,10 @@ export function getThisCodebaseRootDirPath(): string {
|
|
|
20
20
|
|
|
21
21
|
return (result = getThisCodebaseRootDirPath_rec(__dirname));
|
|
22
22
|
}
|
|
23
|
+
|
|
24
|
+
export function getNearestPackageJsonDirPath(dirPath: string): string {
|
|
25
|
+
if (fs.existsSync(path.join(dirPath, 'package.json'))) {
|
|
26
|
+
return dirPath;
|
|
27
|
+
}
|
|
28
|
+
return getNearestPackageJsonDirPath(path.join(dirPath, '..'));
|
|
29
|
+
}
|
|
@@ -1,7 +1,20 @@
|
|
|
1
|
-
import { sep as pathSep } from 'path';
|
|
1
|
+
import { dirname as pathDirname, join as pathJoin, sep as pathSep } from 'path';
|
|
2
|
+
import { getNearestPackageJsonDirPath } from './getThisCodebaseRootDirPath';
|
|
2
3
|
|
|
3
4
|
let cache: string | undefined = undefined;
|
|
4
5
|
|
|
6
|
+
/** NOTE: Careful, this function can fail when the binary
|
|
7
|
+
* Used is not in the node_modules directory of the project
|
|
8
|
+
* (for example when running tests with vscode extension we'll get
|
|
9
|
+
* '/Users/dylan/.vscode/extensions/vitest.explorer-1.16.0/dist/worker.js'
|
|
10
|
+
*
|
|
11
|
+
* instead of
|
|
12
|
+
* '/Users/joseph/.nvm/versions/node/v22.12.0/bin/node'
|
|
13
|
+
* or
|
|
14
|
+
* '/Users/joseph/github/keycloakify-starter/node_modules/.bin/vite'
|
|
15
|
+
*
|
|
16
|
+
* as the value of process.argv[1]
|
|
17
|
+
*/
|
|
5
18
|
export function getNodeModulesBinDirPath() {
|
|
6
19
|
if (cache !== undefined) {
|
|
7
20
|
return cache;
|
|
@@ -9,6 +22,22 @@ export function getNodeModulesBinDirPath() {
|
|
|
9
22
|
|
|
10
23
|
const binPath = process.argv[1];
|
|
11
24
|
|
|
25
|
+
special_case_running_not_from_distribution: {
|
|
26
|
+
if (!binPath.endsWith('.ts')) {
|
|
27
|
+
break special_case_running_not_from_distribution;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const packageJsonDirPath = getNearestPackageJsonDirPath(pathDirname(binPath));
|
|
31
|
+
|
|
32
|
+
const nodeModulesBinDirPath = pathJoin(
|
|
33
|
+
packageJsonDirPath,
|
|
34
|
+
'node_modules',
|
|
35
|
+
'.bin'
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
return nodeModulesBinDirPath;
|
|
39
|
+
}
|
|
40
|
+
|
|
12
41
|
const segments: string[] = ['.bin'];
|
|
13
42
|
|
|
14
43
|
let foundNodeModules = false;
|
|
@@ -30,6 +59,10 @@ export function getNodeModulesBinDirPath() {
|
|
|
30
59
|
segments.unshift(segment);
|
|
31
60
|
}
|
|
32
61
|
|
|
62
|
+
if (!foundNodeModules) {
|
|
63
|
+
throw new Error(`Could not find node_modules in path ${binPath}`);
|
|
64
|
+
}
|
|
65
|
+
|
|
33
66
|
const nodeModulesBinDirPath = segments.join(pathSep);
|
|
34
67
|
|
|
35
68
|
cache = nodeModulesBinDirPath;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import { join as pathJoin, resolve as pathResolve } from 'path';
|
|
3
|
-
import * as fsPr from 'fs/promises';
|
|
4
|
-
import { id } from 'tsafe/id';
|
|
5
|
-
import { assert } from 'tsafe/assert';
|
|
1
|
+
/* eslint-disable @typescript-eslint/consistent-type-imports */
|
|
6
2
|
import chalk from 'chalk';
|
|
7
3
|
import * as crypto from 'crypto';
|
|
8
|
-
import
|
|
4
|
+
import * as fsPr from 'fs/promises';
|
|
5
|
+
import { join as pathJoin, resolve as pathResolve } from 'path';
|
|
6
|
+
import { assert, is } from 'tsafe/assert';
|
|
7
|
+
import { id } from 'tsafe/id';
|
|
9
8
|
import { symToStr } from 'tsafe/symToStr';
|
|
10
|
-
import {
|
|
9
|
+
import { getNodeModulesBinDirPath } from './nodeModulesBinDirPath';
|
|
11
10
|
|
|
12
11
|
getIsPrettierAvailable.cache = id<boolean | undefined>(undefined);
|
|
13
12
|
|
|
@@ -46,38 +45,30 @@ export async function getPrettier(): Promise<PrettierAndConfigHash> {
|
|
|
46
45
|
let prettier = id<typeof import('prettier') | undefined>(undefined);
|
|
47
46
|
|
|
48
47
|
import_prettier: {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
// We make sure to only do that when linking, otherwise we import properly.
|
|
53
|
-
if (readThisNpmPackageVersion().startsWith('0.0.0')) {
|
|
54
|
-
const prettierDirPath = pathResolve(
|
|
55
|
-
pathJoin(getNodeModulesBinDirPath(), '..', 'prettier')
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
const isCJS = typeof module !== 'undefined' && module.exports;
|
|
59
|
-
|
|
60
|
-
if (isCJS) {
|
|
61
|
-
eval(`${symToStr({ prettier })} = require("${prettierDirPath}")`);
|
|
62
|
-
} else {
|
|
63
|
-
prettier = await new Promise(_resolve => {
|
|
64
|
-
eval(
|
|
65
|
-
`import("file:///${pathJoin(prettierDirPath, 'index.mjs').replace(/\\/g, '/')}").then(prettier => _resolve(prettier))`
|
|
66
|
-
);
|
|
67
|
-
});
|
|
68
|
-
}
|
|
48
|
+
const prettierDirPath = pathResolve(
|
|
49
|
+
pathJoin(getNodeModulesBinDirPath(), '..', 'prettier')
|
|
50
|
+
);
|
|
69
51
|
|
|
70
|
-
|
|
52
|
+
const isCJS = typeof module !== 'undefined' && module.exports;
|
|
71
53
|
|
|
72
|
-
|
|
54
|
+
if (isCJS) {
|
|
55
|
+
eval(`${symToStr({ prettier })} = require("${prettierDirPath}")`);
|
|
56
|
+
} else {
|
|
57
|
+
prettier = await new Promise(_resolve => {
|
|
58
|
+
eval(
|
|
59
|
+
`import("file:///${pathJoin(prettierDirPath, 'index.mjs').replace(/\\/g, '/')}").then(prettier => _resolve(prettier))`
|
|
60
|
+
);
|
|
61
|
+
});
|
|
73
62
|
}
|
|
74
63
|
|
|
75
|
-
|
|
64
|
+
assert(!is<undefined>(prettier));
|
|
65
|
+
|
|
66
|
+
break import_prettier;
|
|
76
67
|
}
|
|
77
68
|
|
|
78
69
|
const configHash = await (async () => {
|
|
79
70
|
const configFilePath = await prettier.resolveConfigFile(
|
|
80
|
-
pathJoin(getNodeModulesBinDirPath(), '..')
|
|
71
|
+
pathJoin(getNodeModulesBinDirPath(), '..', '..')
|
|
81
72
|
);
|
|
82
73
|
|
|
83
74
|
if (configFilePath === null) {
|
|
@@ -102,7 +93,15 @@ export async function getPrettier(): Promise<PrettierAndConfigHash> {
|
|
|
102
93
|
export async function runPrettier(params: {
|
|
103
94
|
sourceCode: string;
|
|
104
95
|
filePath: string;
|
|
105
|
-
}): Promise<string
|
|
96
|
+
}): Promise<string>;
|
|
97
|
+
export async function runPrettier(params: {
|
|
98
|
+
sourceCode: Buffer;
|
|
99
|
+
filePath: string;
|
|
100
|
+
}): Promise<Buffer>;
|
|
101
|
+
export async function runPrettier(params: {
|
|
102
|
+
sourceCode: string | Buffer;
|
|
103
|
+
filePath: string;
|
|
104
|
+
}): Promise<string | Buffer> {
|
|
106
105
|
const { sourceCode, filePath } = params;
|
|
107
106
|
|
|
108
107
|
let formattedSourceCode: string;
|
|
@@ -114,17 +113,20 @@ export async function runPrettier(params: {
|
|
|
114
113
|
resolveConfig: true
|
|
115
114
|
});
|
|
116
115
|
|
|
117
|
-
if (ignored) {
|
|
116
|
+
if (ignored || inferredParser === null) {
|
|
118
117
|
return sourceCode;
|
|
119
118
|
}
|
|
120
119
|
|
|
121
120
|
const config = await prettier.resolveConfig(filePath);
|
|
122
121
|
|
|
123
|
-
formattedSourceCode = await prettier.format(
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
122
|
+
formattedSourceCode = await prettier.format(
|
|
123
|
+
typeof sourceCode === 'string' ? sourceCode : sourceCode.toString('utf8'),
|
|
124
|
+
{
|
|
125
|
+
...config,
|
|
126
|
+
filePath,
|
|
127
|
+
parser: inferredParser
|
|
128
|
+
}
|
|
129
|
+
);
|
|
128
130
|
} catch (error) {
|
|
129
131
|
console.log(
|
|
130
132
|
chalk.red(
|
|
@@ -135,5 +137,7 @@ export async function runPrettier(params: {
|
|
|
135
137
|
throw error;
|
|
136
138
|
}
|
|
137
139
|
|
|
138
|
-
return
|
|
140
|
+
return typeof sourceCode === 'string'
|
|
141
|
+
? formattedSourceCode
|
|
142
|
+
: Buffer.from(formattedSourceCode, 'utf8');
|
|
139
143
|
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { getThisCodebaseRootDirPath } from './getThisCodebaseRootDirPath';
|
|
2
|
-
import { assert } from 'tsafe/assert';
|
|
3
|
-
import * as fs from 'fs';
|
|
4
|
-
import { join as pathJoin } from 'path';
|
|
5
|
-
|
|
6
|
-
let cache: string | undefined = undefined;
|
|
7
|
-
|
|
8
|
-
export function readThisNpmPackageVersion(): string {
|
|
9
|
-
if (cache !== undefined) {
|
|
10
|
-
return cache;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const version = JSON.parse(
|
|
14
|
-
fs
|
|
15
|
-
.readFileSync(pathJoin(getThisCodebaseRootDirPath(), 'package.json'))
|
|
16
|
-
.toString('utf8')
|
|
17
|
-
)['version'];
|
|
18
|
-
|
|
19
|
-
assert(typeof version === 'string');
|
|
20
|
-
|
|
21
|
-
cache = version;
|
|
22
|
-
|
|
23
|
-
return version;
|
|
24
|
-
}
|