diff --git a/lib/js/src/compose/types/page-block/automation.ts b/lib/js/src/compose/types/page-block/automation.ts index ab5fdce20..6d3149c61 100644 --- a/lib/js/src/compose/types/page-block/automation.ts +++ b/lib/js/src/compose/types/page-block/automation.ts @@ -1,5 +1,6 @@ import { PageBlock, PageBlockInput, Registry } from './base' import { Button } from './types' +import { Apply } from '../../../cast' const kind = 'Automation' @@ -12,11 +13,13 @@ interface Options { // // Default behaviour is to add new buttons automatically. sealed: boolean; + magnifyOption: string; } const defaults: Readonly = Object.freeze({ buttons: [], sealed: false, + magnifyOption: '', }) export class PageBlockAutomation extends PageBlock { @@ -32,6 +35,8 @@ export class PageBlockAutomation extends PageBlock { applyOptions (o?: Partial): void { if (!o) return + Apply(this.options, o, String, 'magnifyOption') + if (o.buttons) { this.options.buttons = o.buttons.map(b => new Button(b)) } diff --git a/lib/js/src/compose/types/page-block/geometry/page-block.ts b/lib/js/src/compose/types/page-block/geometry/page-block.ts index 56dc3dc7f..65d8cda80 100644 --- a/lib/js/src/compose/types/page-block/geometry/page-block.ts +++ b/lib/js/src/compose/types/page-block/geometry/page-block.ts @@ -16,6 +16,7 @@ interface Options { zoomMax: number; bounds: Bounds | null; lockBounds: boolean; + magnifyOption: string; } const defaults: Readonly = Object.freeze({ @@ -27,6 +28,7 @@ const defaults: Readonly = Object.freeze({ zoomMax: 18, bounds: null, lockBounds: false, + magnifyOption: '', }) export class PageBlockGeometry extends PageBlock { @@ -49,6 +51,7 @@ export class PageBlockGeometry extends PageBlock { this.options.center = (o.center || []) this.options.bounds = (o.bounds || null) + Apply(this.options, o, String, 'magnifyOption') Apply(this.options, o, Number, 'zoomStarting', 'zoomMin', 'zoomMax') Apply(this.options, o, Boolean, 'lockBounds') } diff --git a/lib/js/src/compose/types/page-block/metric.ts b/lib/js/src/compose/types/page-block/metric.ts index 176c6f804..a1037aba5 100644 --- a/lib/js/src/compose/types/page-block/metric.ts +++ b/lib/js/src/compose/types/page-block/metric.ts @@ -42,12 +42,14 @@ interface Options { metrics: Array; refreshRate: number; showRefresh: boolean; + magnifyOption: string; } const defaults: Readonly = Object.freeze({ metrics: [], refreshRate: 0, showRefresh: false, + magnifyOption: '', }) export class PageBlockMetric extends PageBlock { @@ -64,6 +66,7 @@ export class PageBlockMetric extends PageBlock { if (!o) return Apply(this.options, o, Number, 'refreshRate') Apply(this.options, o, Boolean, 'showRefresh') + Apply(this.options, o, String, 'magnifyOption') if (o.metrics) { this.options.metrics = o.metrics } diff --git a/lib/js/src/compose/types/page-block/navigation/index.ts b/lib/js/src/compose/types/page-block/navigation/index.ts index d68e9e9b2..be81d0e5e 100644 --- a/lib/js/src/compose/types/page-block/navigation/index.ts +++ b/lib/js/src/compose/types/page-block/navigation/index.ts @@ -1,5 +1,6 @@ import { PageBlock, PageBlockInput, Registry } from '../base' import NavigationItem, { NavigationItemInput } from './navigation-item' +import { Apply } from '../../../../cast' const kind = 'Navigation' @@ -12,6 +13,7 @@ interface DisplayOptions { interface Options { display: DisplayOptions; navigationItems: NavigationItem[]; + magnifyOption: string; } const defaults: Readonly = Object.freeze({ @@ -21,6 +23,7 @@ const defaults: Readonly = Object.freeze({ fillJustify: 'justify', }, navigationItems: [], + magnifyOption: '', }) export class PageBlockNavigation extends PageBlock { @@ -41,6 +44,8 @@ export class PageBlockNavigation extends PageBlock { if (o.display) { this.options.display = o.display } + + Apply(this.options, o, String, 'magnifyOption') } static makeNavigationItem (item?: NavigationItemInput): NavigationItem { diff --git a/lib/js/src/compose/types/page-block/nylas.ts b/lib/js/src/compose/types/page-block/nylas.ts index 3f3b27df5..649d36e21 100644 --- a/lib/js/src/compose/types/page-block/nylas.ts +++ b/lib/js/src/compose/types/page-block/nylas.ts @@ -6,11 +6,13 @@ const kind = 'Nylas' interface Options { kind: string, componentID: string; + magnifyOption: string; } const defaults: Readonly = Object.freeze({ kind: 'Composer', // Default kind of nylas component componentID: '', + magnifyOption: '', }) export class PageBlockNylas extends PageBlock { @@ -26,7 +28,7 @@ export class PageBlockNylas extends PageBlock { applyOptions (o?: Partial): void { if (!o) return - Apply(this.options, o, String, 'kind', 'componentID') + Apply(this.options, o, String, 'kind', 'componentID', 'magnifyOption') } } diff --git a/lib/js/src/compose/types/page-block/progress.ts b/lib/js/src/compose/types/page-block/progress.ts index 9e97e9136..acf0f0164 100644 --- a/lib/js/src/compose/types/page-block/progress.ts +++ b/lib/js/src/compose/types/page-block/progress.ts @@ -35,6 +35,7 @@ interface Options { display: DisplayOptions; refreshRate: number; showRefresh: boolean; + magnifyOption: string; } const defaults: Readonly = Object.freeze({ @@ -72,6 +73,7 @@ const defaults: Readonly = Object.freeze({ }, refreshRate: 0, showRefresh: false, + magnifyOption: '', }) export class PageBlockProgress extends PageBlock { @@ -89,6 +91,7 @@ export class PageBlockProgress extends PageBlock { Apply(this.options, o, Number, 'refreshRate') Apply(this.options, o, Boolean, 'showRefresh') + Apply(this.options, o, String, 'magnifyOption') if (o.value) { this.options.value = { ...this.options.value, ...o.value } diff --git a/lib/js/src/compose/types/page-block/record-organizer.ts b/lib/js/src/compose/types/page-block/record-organizer.ts index e84c3dcf1..48329fdf1 100644 --- a/lib/js/src/compose/types/page-block/record-organizer.ts +++ b/lib/js/src/compose/types/page-block/record-organizer.ts @@ -12,6 +12,7 @@ interface Options { group: string; refreshRate: number; showRefresh: boolean; + magnifyOption: string; } const defaults: Readonly = Object.freeze({ @@ -24,6 +25,7 @@ const defaults: Readonly = Object.freeze({ group: '', refreshRate: 0, showRefresh: false, + magnifyOption: '', }) export class PageBlockRecordOrganizer extends PageBlock { @@ -40,7 +42,7 @@ export class PageBlockRecordOrganizer extends PageBlock { if (!o) return Apply(this.options, o, CortezaID, 'moduleID') - Apply(this.options, o, String, 'labelField', 'descriptionField', 'filter', 'positionField', 'groupField', 'group') + Apply(this.options, o, String, 'labelField', 'descriptionField', 'filter', 'positionField', 'groupField', 'group', 'magnifyOption') Apply(this.options, o, Number, 'refreshRate') Apply(this.options, o, Boolean, 'showRefresh') } diff --git a/lib/js/src/compose/types/page-block/record.ts b/lib/js/src/compose/types/page-block/record.ts index fe517181a..1a9147024 100644 --- a/lib/js/src/compose/types/page-block/record.ts +++ b/lib/js/src/compose/types/page-block/record.ts @@ -1,4 +1,5 @@ import { PageBlock, PageBlockInput, Registry } from './base' +import { Apply } from '../../../cast' const kind = 'Record' @@ -10,11 +11,13 @@ interface FieldCondition { interface Options { fields: unknown[]; fieldConditions: FieldCondition[]; + magnifyOption: string; } const defaults: Readonly = Object.freeze({ fields: [], fieldConditions: [], + magnifyOption: '', }) export class PageBlockRecord extends PageBlock { @@ -30,6 +33,8 @@ export class PageBlockRecord extends PageBlock { applyOptions (o?: Partial): void { if (!o) return + Apply(this.options, o, String, 'magnifyOption') + if (o.fields) { this.options.fields = o.fields } diff --git a/lib/js/src/compose/types/page-block/social-feed.ts b/lib/js/src/compose/types/page-block/social-feed.ts index b06cc2819..1fd34ef5e 100644 --- a/lib/js/src/compose/types/page-block/social-feed.ts +++ b/lib/js/src/compose/types/page-block/social-feed.ts @@ -9,6 +9,7 @@ interface Options { profileUrl: string; showRefresh: boolean; refreshRate: number; + magnifyOption: string; } const defaults: Readonly = Object.freeze({ @@ -18,6 +19,7 @@ const defaults: Readonly = Object.freeze({ profileUrl: '', showRefresh: false, refreshRate: 0, + magnifyOption: '', }) export class PageBlockSocialFeed extends PageBlock { @@ -34,7 +36,7 @@ export class PageBlockSocialFeed extends PageBlock { if (!o) return Apply(this.options, o, CortezaID, 'moduleID') - Apply(this.options, o, String, 'profileSourceField', 'profileUrl') + Apply(this.options, o, String, 'profileSourceField', 'profileUrl', 'magnifyOption') Apply(this.options, o, Number, 'refreshRate') Apply(this.options, o, Boolean, 'showRefresh') diff --git a/lib/js/src/compose/types/page-block/tabs.ts b/lib/js/src/compose/types/page-block/tabs.ts index f3f7d6c91..d89c6b365 100644 --- a/lib/js/src/compose/types/page-block/tabs.ts +++ b/lib/js/src/compose/types/page-block/tabs.ts @@ -1,4 +1,5 @@ import { PageBlock, PageBlockInput, Registry } from './base' +import { Apply } from '../../../cast' const kind = 'Tabs' @@ -18,6 +19,7 @@ interface Tab { interface Options { style: Style; tabs: Tab[]; + magnifyOption: string; } const defaults: Readonly = Object.freeze({ @@ -29,6 +31,7 @@ const defaults: Readonly = Object.freeze({ position: 'start', }, tabs: [], + magnifyOption: '', }) export class PageBlockTab extends PageBlock { @@ -44,6 +47,8 @@ export class PageBlockTab extends PageBlock { applyOptions (o?: Partial): void { if (!o) return + Apply(this.options, o, String, 'magnifyOption') + if (o.tabs) { this.options.tabs = o.tabs }