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.

132 lines (131 loc) 6.17 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 { Choice, DataType, DisplayName, KnownFieldTypes, WidgetEntity, Model, DataModel, ComplexType, TableView, Description, ContentSection, DefaultValue, ConditionalVisibility, Required, ContentSectionTitles, ViewSelector, Category, WidgetLabel, PropertyCategory, StringLength } from '@progress/sitefinity-widget-designers-sdk'; import { SectionType } from './section-type'; import { OffsetStyle } from '../../styling/offset-style'; let Section = class Section { sectionType; }; __decorate([ Choice([ { Name: 'Page title and summary', Value: SectionType.TitleAndSummary }, { Name: 'Rich Text', Value: SectionType.RichText }, { Name: 'FAQ', Value: SectionType.FAQ }, { Name: 'Hero', Value: SectionType.Hero }, { Name: 'Content items - list', Value: SectionType.ContentList }, { Name: 'Content items - cards', Value: SectionType.ContentListCards } ]), DisplayName(' ') ], Section.prototype, "sectionType", void 0); Section = __decorate([ Model() ], Section); export var NoIntentAction; (function (NoIntentAction) { NoIntentAction["None"] = "None"; NoIntentAction["GenerateWithPredefinedQuery"] = "GenerateWithPredefinedQuery"; })(NoIntentAction || (NoIntentAction = {})); let IntentDrivenContentEntity = class IntentDrivenContentEntity { SectionsConfiguration = []; NoProvidedIntent = NoIntentAction.None; DefaultQuery = null; SfViewName = 'Default'; Margins = null; SfWidgetLabel = null; ContentCssClass = ''; PageTitleAndSummaryCssClass = ''; SectionTitleAndSummaryCssClass = ''; RichTextCssClass = ''; ContentItemsListCssClass = ''; ContentItemsCardsCssClass = ''; HeroCssClass = ''; FaqCssClass = ''; }; __decorate([ DataModel(Section), DataType(ComplexType.Enumerable), DisplayName('Generated content contains..'), Description('Specify the content structure. The components (title and summary, rich text, FAQ, etc.) will be filled with content from your site — contextually assembled or generated. If an element isn’t relevant to the user’s intent, it won’t be generated.'), TableView({ Reorderable: true, HideRowsIfEmpty: true }), ContentSection('Content setup', 1) ], IntentDrivenContentEntity.prototype, "SectionsConfiguration", void 0); __decorate([ ContentSection('Content setup', 3), DisplayName('When no intent is provided...'), Choice([ { 'Name': 'Display nothing', 'Title': 'Display nothing', 'Value': NoIntentAction.None }, { 'Name': 'Generate content for the following intent...', 'Title': 'Generate content for the following intent...', 'Value': NoIntentAction.GenerateWithPredefinedQuery } ]), DataType(KnownFieldTypes.RadioChoice), DefaultValue(NoIntentAction.None) ], IntentDrivenContentEntity.prototype, "NoProvidedIntent", void 0); __decorate([ DisplayName(''), ContentSection('Content setup', 5), ConditionalVisibility({ conditions: [{ fieldName: 'NoProvidedIntent', operator: 'Equals', value: NoIntentAction.GenerateWithPredefinedQuery }] }), Required(), StringLength(1024, 'The default query cannot exceed 1024 characters.') ], IntentDrivenContentEntity.prototype, "DefaultQuery", void 0); __decorate([ ViewSelector(), ContentSection(ContentSectionTitles.DisplaySettings, 1), DisplayName('Intent-driven content template') ], IntentDrivenContentEntity.prototype, "SfViewName", void 0); __decorate([ ContentSection('Display settings', 2), DisplayName('Margins'), DataModel(OffsetStyle), TableView('Content block') ], IntentDrivenContentEntity.prototype, "Margins", void 0); __decorate([ WidgetLabel(), DefaultValue('Intent Driven Content Widget') ], IntentDrivenContentEntity.prototype, "SfWidgetLabel", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Custom CSS classes'), DisplayName('Intent-driven content') ], IntentDrivenContentEntity.prototype, "ContentCssClass", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Custom CSS classes'), DisplayName('Page title and summary') ], IntentDrivenContentEntity.prototype, "PageTitleAndSummaryCssClass", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Custom CSS classes'), DisplayName('Section title and summary') ], IntentDrivenContentEntity.prototype, "SectionTitleAndSummaryCssClass", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Custom CSS classes'), DisplayName('Rich Text') ], IntentDrivenContentEntity.prototype, "RichTextCssClass", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Custom CSS classes'), DisplayName('Content items - list') ], IntentDrivenContentEntity.prototype, "ContentItemsListCssClass", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Custom CSS classes'), DisplayName('Content items - cards') ], IntentDrivenContentEntity.prototype, "ContentItemsCardsCssClass", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Custom CSS classes'), DisplayName('Hero') ], IntentDrivenContentEntity.prototype, "HeroCssClass", void 0); __decorate([ Category(PropertyCategory.Advanced), ContentSection('Custom CSS classes'), DisplayName('FAQ') ], IntentDrivenContentEntity.prototype, "FaqCssClass", void 0); IntentDrivenContentEntity = __decorate([ WidgetEntity('SitefinityIntentDrivenContent') ], IntentDrivenContentEntity); export { IntentDrivenContentEntity };