UNPKG

@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.

100 lines (99 loc) 4.32 kB
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 { WidgetEntity, DisplayName, DataType, ContentSection, WidgetLabel, DefaultValue, Description, Content, KnownContentTypes, Choice, ConditionalVisibility, KnownFieldTypes, TableView, PropertyCategory, Category, ContentSectionTitles, DataModel, ComplexType, ViewSelector } from '@progress/sitefinity-widget-designers-sdk'; import { OffsetStyle } from '../../styling/offset-style'; export var AfterIntentAction; (function (AfterIntentAction) { AfterIntentAction["Stay"] = "stay"; AfterIntentAction["Redirect"] = "redirect"; })(AfterIntentAction || (AfterIntentAction = {})); let IntentBoxEntity = class IntentBoxEntity { AfterIntentIsSubmitted = AfterIntentAction.Stay; TargetPage = null; SfWidgetLabel = 'Input With Page Property'; Suggestions = []; SfViewName = 'Default'; Margins = null; CssClass = ''; Label = null; PlaceholderText = null; SuggestionsLabel = null; SubmitButtonTooltip = null; }; __decorate([ DisplayName('After Intent is submitted...'), Description('Make sure the selected page contains the Intent-driven content widget.'), DataType(KnownFieldTypes.RadioChoice), Choice([{ 'Title': 'Stay on the same page', 'Value': AfterIntentAction.Stay }, { 'Title': 'Redirect to page...', 'Value': AfterIntentAction.Redirect }]), DefaultValue(AfterIntentAction.Stay) ], IntentBoxEntity.prototype, "AfterIntentIsSubmitted", void 0); __decorate([ DisplayName(''), Content({ Type: KnownContentTypes.Pages, AllowMultipleItemsSelection: false }), ConditionalVisibility({ conditions: [ { fieldName: 'AfterIntentIsSubmitted', operator: 'Equals', value: AfterIntentAction.Redirect } ], inline: true }), DefaultValue(null) ], IntentBoxEntity.prototype, "TargetPage", void 0); __decorate([ WidgetLabel() ], IntentBoxEntity.prototype, "SfWidgetLabel", void 0); __decorate([ DisplayName('Suggestions'), TableView({ Reorderable: true }), DataType(ComplexType.Enumerable, 'string') ], IntentBoxEntity.prototype, "Suggestions", void 0); __decorate([ ContentSection(ContentSectionTitles.DisplaySettings, 2), ViewSelector(), ContentSection(ContentSectionTitles.DisplaySettings, 1), DisplayName('Intent-driven content template') ], IntentBoxEntity.prototype, "SfViewName", void 0); __decorate([ ContentSection('Display settings', 2), DisplayName('Margins'), DataModel(OffsetStyle), TableView('Content block') ], IntentBoxEntity.prototype, "Margins", void 0); __decorate([ Category(PropertyCategory.Advanced), DisplayName('CSS class') ], IntentBoxEntity.prototype, "CssClass", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Labels and messages', 1), DefaultValue('What are you looking for today?'), DisplayName('Label') ], IntentBoxEntity.prototype, "Label", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Labels and messages', 2), DefaultValue('Ask for products, rates, or services... '), DisplayName('Placeholder text') ], IntentBoxEntity.prototype, "PlaceholderText", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Labels and messages', 3), DefaultValue('You can ask...'), DisplayName('Suggestions label') ], IntentBoxEntity.prototype, "SuggestionsLabel", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Labels and messages', 4), DefaultValue('Send'), DisplayName('Submit button tooltip') ], IntentBoxEntity.prototype, "SubmitButtonTooltip", void 0); IntentBoxEntity = __decorate([ WidgetEntity('SitefinityIntentBox') ], IntentBoxEntity); export { IntentBoxEntity };