@progress/sitefinity-nextjs-sdk
Version:
Provides OOB widgets developed using the Next.js framework, which includes an abstraction layer for Sitefinity communication. Additionally, it offers an expanded API, typings, and tools for further development and integration.
252 lines (251 loc) • 11 kB
JavaScript
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Category, Choice, ConditionalVisibility, Content, ContentSection, DataModel, DataType, DefaultValue, Description, DisplayName, KeysValues, KnownFieldTypes, LengthDependsOn, Margins, PropertyCategory, ViewSelector, WidgetEntity, WidgetLabel } from '@progress/sitefinity-widget-designers-sdk';
import { PostRegistrationAction } from './interfaces/post-registration-action';
import { RestSdkTypes } from '../../rest-sdk/rest-client';
let RegistrationEntity = class RegistrationEntity {
PostRegistrationAction = PostRegistrationAction.ViewMessage;
PostRegistrationRedirectPage;
LoginPage;
ExternalProviders;
SfViewName = 'Default';
Margins;
// Advanced
SfWidgetLabel = 'Registration';
CssClass;
Header = 'Registration';
FirstNameLabel = 'First name';
LastNameLabel = 'Last name';
EmailLabel = 'Email';
PasswordLabel = 'Password';
RepeatPasswordLabel = 'Repeat password';
SecretQuestionLabel = 'Secret question';
SecretAnswerLabel = 'Secret answer';
RegisterButtonLabel = 'Register';
ActivationLinkHeader = 'Please check your email';
ActivationLinkLabel = 'An activation link has been sent to';
SendAgainLink = 'Send again';
SendAgainLabel = 'Another activation link has been sent to {0}. If you have not received an email please check your spam box.';
SuccessHeader = 'Thank you!';
SuccessLabel = 'You are successfully registered.';
LoginLabel = 'Already registered?';
LoginLink = 'Log in';
ExternalProvidersHeader = 'or connect with...';
ValidationRequiredMessage = 'All fields are required.';
ValidationInvalidEmailMessage = 'Invalid email format.';
ValidationMismatchMessage = 'Password and repeat password don\'t match.';
ActivationMessage = 'Your account is activated';
ActivationFailTitle = 'Error has occured';
ActivationFailLabel = 'We could not activate your account.';
ActivationExpiredHeader = 'Activation link has expired';
ActivationExpiredLabel = 'To access your account resend activation link to {0}';
ActivationExpiredBtnText = 'Send activation link';
Attributes;
};
__decorate([
DisplayName('If form is submitted successfully, users will...'),
ContentSection('Select pages', 1),
DataType(KnownFieldTypes.RadioChoice),
Choice([
{ Title: 'View a message', Value: PostRegistrationAction.ViewMessage },
{ Title: 'Redirect to page...', Value: PostRegistrationAction.RedirectToPage }
])
], RegistrationEntity.prototype, "PostRegistrationAction", void 0);
__decorate([
Content({
Type: RestSdkTypes.Pages,
AllowMultipleItemsSelection: false
}),
DisplayName(''),
ContentSection('Select pages', 1),
ConditionalVisibility('{\u0022conditions\u0022:[{\u0022fieldName\u0022:\u0022PostRegistrationAction\u0022,\u0022operator\u0022:\u0022Equals\u0022,\u0022value\u0022:\u0022RedirectToPage\u0022}],\u0022inline\u0022:\u0022true\u0022}'),
DefaultValue(null)
], RegistrationEntity.prototype, "PostRegistrationRedirectPage", void 0);
__decorate([
Content({
Type: RestSdkTypes.Pages,
AllowMultipleItemsSelection: false
}),
DisplayName('Login page'),
ContentSection('Select pages', 1),
Description('This is the page where you have dropped the Login form widget. If you leave this field empty, a link to the Login page will not be displayed in the Registration widget.'),
DefaultValue(null)
], RegistrationEntity.prototype, "LoginPage", void 0);
__decorate([
ContentSection('Register with external providers', 1),
DisplayName('Allow users to log in with...'),
DataType(KnownFieldTypes.MultipleChoiceChip),
Choice({
ActionTitle: 'Select external providers',
NotResponsive: false,
ButtonTitle: 'Add',
ServiceUrl: '/Default.GetExternalProviders()'
})
], RegistrationEntity.prototype, "ExternalProviders", void 0);
__decorate([
ContentSection('Display settings', 1),
ViewSelector([{ Value: 'Default' }]),
DisplayName('Registration template')
], RegistrationEntity.prototype, "SfViewName", void 0);
__decorate([
ContentSection('Display settings', 1),
Margins('Registration')
], RegistrationEntity.prototype, "Margins", void 0);
__decorate([
WidgetLabel()
], RegistrationEntity.prototype, "SfWidgetLabel", void 0);
__decorate([
DisplayName('CSS class'),
Category(PropertyCategory.Advanced)
], RegistrationEntity.prototype, "CssClass", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Registration header')
], RegistrationEntity.prototype, "Header", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('First name field label')
], RegistrationEntity.prototype, "FirstNameLabel", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Last name field label')
], RegistrationEntity.prototype, "LastNameLabel", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Email field label')
], RegistrationEntity.prototype, "EmailLabel", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Password field label')
], RegistrationEntity.prototype, "PasswordLabel", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Reset password field label')
], RegistrationEntity.prototype, "RepeatPasswordLabel", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Secret question field label')
], RegistrationEntity.prototype, "SecretQuestionLabel", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Secret answer field label')
], RegistrationEntity.prototype, "SecretAnswerLabel", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Register button')
], RegistrationEntity.prototype, "RegisterButtonLabel", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Activation link header')
], RegistrationEntity.prototype, "ActivationLinkHeader", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Activation link label')
], RegistrationEntity.prototype, "ActivationLinkLabel", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Send again link')
], RegistrationEntity.prototype, "SendAgainLink", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Send again label')
], RegistrationEntity.prototype, "SendAgainLabel", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Success header')
], RegistrationEntity.prototype, "SuccessHeader", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Success label')
], RegistrationEntity.prototype, "SuccessLabel", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Login label')
], RegistrationEntity.prototype, "LoginLabel", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Login link')
], RegistrationEntity.prototype, "LoginLink", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('External providers header')
], RegistrationEntity.prototype, "ExternalProvidersHeader", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Required fields error message')
], RegistrationEntity.prototype, "ValidationRequiredMessage", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Invalid email error message')
], RegistrationEntity.prototype, "ValidationInvalidEmailMessage", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Password mismatch error message')
], RegistrationEntity.prototype, "ValidationMismatchMessage", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Activation message')
], RegistrationEntity.prototype, "ActivationMessage", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Activation error title')
], RegistrationEntity.prototype, "ActivationFailTitle", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Activation error message')
], RegistrationEntity.prototype, "ActivationFailLabel", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Expired activation link title')
], RegistrationEntity.prototype, "ActivationExpiredHeader", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Expired activation link message')
], RegistrationEntity.prototype, "ActivationExpiredLabel", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages'),
DisplayName('Activation expired button text')
], RegistrationEntity.prototype, "ActivationExpiredBtnText", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Attributes'),
DisplayName('Attributes for...'),
DataType(KnownFieldTypes.Attributes),
DataModel(KeysValues),
LengthDependsOn(null, '', ' ', '[{"Name": "Registration", "Title": "Registration"}]')
], RegistrationEntity.prototype, "Attributes", void 0);
RegistrationEntity = __decorate([
WidgetEntity('SitefinityRegistration', 'Registration')
], RegistrationEntity);
export { RegistrationEntity };