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.

134 lines (133 loc) 8.92 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 { OffsetStyle } from '../styling/offset-style'; import { RestSdkTypes } from '../../rest-sdk/rest-client'; import { ComplexType, ContentSectionTitles, KnownFieldTypes } from '@progress/sitefinity-widget-designers-sdk/common'; import { ContentSection } from '@progress/sitefinity-widget-designers-sdk/decorators/content-section'; import { DefaultValue } from '@progress/sitefinity-widget-designers-sdk/decorators/default-value'; import { Description } from '@progress/sitefinity-widget-designers-sdk/decorators/description'; import { DisplayName } from '@progress/sitefinity-widget-designers-sdk/decorators/display-name'; import { DataModel, DataType } from '@progress/sitefinity-widget-designers-sdk/decorators/data-type'; import { Choice } from '@progress/sitefinity-widget-designers-sdk/decorators/choice'; import { Category } from '@progress/sitefinity-widget-designers-sdk/decorators/category'; import { WidgetEntity } from '@progress/sitefinity-widget-designers-sdk/decorators/widget-entity'; import { ViewSelector } from '@progress/sitefinity-widget-designers-sdk/decorators/view-selector'; import { TableView } from '@progress/sitefinity-widget-designers-sdk/decorators/table-view'; import { WidgetLabel } from '@progress/sitefinity-widget-designers-sdk/decorators/widget-label'; import { Attributes, KeysValues } from '@progress/sitefinity-widget-designers-sdk/decorators/attributes'; import { Placeholder } from '@progress/sitefinity-widget-designers-sdk/decorators/placeholder'; import { Required } from '@progress/sitefinity-widget-designers-sdk/decorators/validations'; import { Content } from '@progress/sitefinity-widget-designers-sdk/decorators/content'; import { ConditionalVisibility } from '@progress/sitefinity-widget-designers-sdk/decorators/conditional-visibility'; let SearchBoxEntity = class SearchBoxEntity { SearchIndex = null; SearchResultsPage = null; SuggestionsTriggerCharCount; ScoringProfile; ScoringParameters; SfViewName = 'Default'; Margins = null; SfWidgetLabel = 'Search box'; CssClass = null; SuggestionFields = null; ShowResultsForAllIndexedSites = 0; SearchBoxPlaceholder = 'Search...'; SearchButtonLabel = 'Search'; Attributes = null; }; __decorate([ ContentSection('Search setup', 0), DisplayName('Specify content to search in'), Placeholder('Select search index'), Required('Please select a search index'), DataType(KnownFieldTypes.Choices), Choice({ ServiceUrl: 'Default.GetSearchIndexes', ServiceWarningMessage: 'No search indexes have been created.' }), Description('[{"Type":1,"Chunks":[{"Value":"Use search indexes to define different sets","Presentation":[]}, {"Value":"of content visitors can search by using the","Presentation":[2]}, {"Value":"internal search of the your site.","Presentation":[2]}]},{"Type":1,"Chunks":[{"Value":"Manage search indexes in","Presentation":[]},{"Value":"Administration > Search indexes","Presentation":[2,3]}]}]') ], SearchBoxEntity.prototype, "SearchIndex", void 0); __decorate([ ContentSection('Search setup', 1), DisplayName('Search results page'), Content({ Type: RestSdkTypes.Pages, AllowMultipleItemsSelection: false }), Description('This is the page where you have dropped the Search results widget.'), Required('Please select a search results page') ], SearchBoxEntity.prototype, "SearchResultsPage", void 0); __decorate([ DefaultValue(0), ContentSection('Search setup', 2), DisplayName('Display suggestions after typing...'), DataType(KnownFieldTypes.ChipChoice), Choice({ Choices: [{ 'Title': 'Don\'t display suggestions', 'Name': '0', 'Value': 0, 'Icon': 'ban' }, { 'Title': '2', 'Name': '2', 'Value': 2, 'Icon': null }, { 'Title': '3', 'Name': '3', 'Value': 3, 'Icon': null }, { 'Title': '4', 'Name': '4', 'Value': 4, 'Icon': null }], SideLabel: 'characters' }) ], SearchBoxEntity.prototype, "SuggestionsTriggerCharCount", void 0); __decorate([ ContentSection('Boost search results', 0), DisplayName('Scoring profile'), Placeholder('Select scoring'), DataType(KnownFieldTypes.Choices), Choice({ ServiceUrl: '/Default.GetScoringProfiles(catalogName=\'{0}\')', ServiceCallParameters: '[{ "catalogName" : "{0}"}]' }), Description('Scoring profiles are part of the search index and consist of weighted fields, functions, and parameters. Use scoring profiles to boost search results by customizing the way different fields are ranked. Manage scoring profiles in the Azure portal.') ], SearchBoxEntity.prototype, "ScoringProfile", void 0); __decorate([ ContentSection('Boost search results', 1), DisplayName('Scoring parameters'), Description('[{"Type":1,"Chunks":[{"Value":"Scoring parameters are part of the scoring","Presentation":[]}, {"Value":"functions within a scorig profile. Add","Presentation":[2]}, {"Value":"scoring parameters to boost content to","Presentation":[2]}, {"Value":"appear higher in the search results by","Presentation":[2]}, {"Value":"specifying the parameter\'s name and","Presentation":[2]}, {"Value":"value.","Presentation":[2]}, {"Value":"Example: ","Presentation":[]}, {"Value":"testparam:tag1","Presentation":[3]}, {"Value":"Manage scoring parameters in the Azure","Presentation":[2]}, {"Value":"portal.","Presentation":[2]}]}]'), ConditionalVisibility('{"conditions":[{"fieldName":"ScoringProfile","operator":"NotEquals","value":null}]}'), DataType(ComplexType.Enumerable, 'string') ], SearchBoxEntity.prototype, "ScoringParameters", void 0); __decorate([ ContentSection(ContentSectionTitles.DisplaySettings, 0), ViewSelector([{ Title: 'Default', Name: 'Default', Value: 'Default', Icon: null }]), DisplayName('Search box template') ], SearchBoxEntity.prototype, "SfViewName", void 0); __decorate([ ContentSection(ContentSectionTitles.DisplaySettings, 1), DisplayName('Margins'), DataModel(OffsetStyle), TableView('Search box') ], SearchBoxEntity.prototype, "Margins", void 0); __decorate([ WidgetLabel() ], SearchBoxEntity.prototype, "SfWidgetLabel", void 0); __decorate([ Category('Advanced'), DisplayName('CSS class') ], SearchBoxEntity.prototype, "CssClass", void 0); __decorate([ Category('Advanced'), DisplayName('Suggestion fields'), DefaultValue('Title,Content'), Description('List the fields to be used in the search suggestions. These fields must be included in the search index.') ], SearchBoxEntity.prototype, "SuggestionFields", void 0); __decorate([ Category('Advanced'), DisplayName('Search scope'), DataType(KnownFieldTypes.Choices), DefaultValue(0), Choice({ Choices: [{ 'Title': 'All sites in the index', 'Name': '1', 'Value': 1, 'Icon': null }, { 'Title': 'Current site only', 'Name': '2', 'Value': 2, 'Icon': null }, { 'Title': 'As set for the system', 'Name': '0', 'Value': 0, 'Icon': 'ban' }], SideLabel: 'characters' }), Description('[{"Type":1,"Chunks":[{"Value":"This setting takes effect only if your search index","Presentation":[]}, {"Value":"contains multiple sites. It’s possible to search","Presentation":[2]}, {"Value":"in all of the sites in the index or in the current","Presentation":[2]}, {"Value":"site only.","Presentation":[2]}]},{"Type":1,"Chunks":[{"Value":"To see how this is set for the system, go to","Presentation":[]},{"Value":"Administration > Settings > Advanced > Search","Presentation":[2,3]},{"Value":"and find the setting Search in all sites in an index.","Presentation":[]}]}]') ], SearchBoxEntity.prototype, "ShowResultsForAllIndexedSites", void 0); __decorate([ Category('Advanced'), ContentSection('Labels and messages', 0), DisplayName('Search box placeholder text'), DefaultValue('Search...') ], SearchBoxEntity.prototype, "SearchBoxPlaceholder", void 0); __decorate([ Category('Advanced'), ContentSection('Labels and messages', 1), DisplayName('Search button'), DefaultValue('Search') ], SearchBoxEntity.prototype, "SearchButtonLabel", void 0); __decorate([ Attributes('SearchBox', 'Search box', 0), ContentSection('Attributes', 0), Category('Advanced'), DataModel(KeysValues) ], SearchBoxEntity.prototype, "Attributes", void 0); SearchBoxEntity = __decorate([ WidgetEntity('SitefinitySearchBox', 'Search box') ], SearchBoxEntity); export { SearchBoxEntity };