@seatsio/seatsio-react 14.12.0 → 14.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/main/Embeddable.tsx","../src/main/util.ts"],"sourcesContent":["import * as React from 'react'\nimport {didPropsChange} from './util'\nimport { ChartDesigner, CommonConfigOptions, EventManager, Region, SeatingChart, Seatsio } from '@seatsio/seatsio-types'\n\nexport type EmbeddableProps<T > = {\n onRenderStarted?: (chart: SeatingChart | EventManager) => void\n chartJsUrl?: string\n region: Region\n} & T\n\nexport default abstract class Embeddable<T extends CommonConfigOptions> extends React.Component<EmbeddableProps<T>> {\n private container: React.RefObject<HTMLDivElement>\n private chart: SeatingChart\n private firstRender: boolean\n\n private static seatsioBundles: { [key: string]: Promise<Seatsio> } = {}\n\n static defaultProps = {\n chartJsUrl: 'https://cdn-{region}.seatsio.net/chart.js'\n }\n\n constructor(props: EmbeddableProps<T>) {\n super(props);\n this.container = React.createRef()\n this.firstRender = true\n }\n\n abstract createChart (seatsio: Seatsio, config: T): SeatingChart | EventManager | ChartDesigner\n\n componentDidMount () {\n if (!Embeddable.seatsioBundles[this.getChartUrl()] || this.firstRender) {\n this.createAndRenderChart()\n this.firstRender = false\n }\n }\n\n componentDidUpdate (prevProps: EmbeddableProps<T>) {\n if (didPropsChange(this.props, prevProps) && this.chart) {\n this.destroyChart()\n this.createAndRenderChart()\n }\n }\n\n getChartUrl () {\n return this.props.chartJsUrl.replace('{region}', this.props.region)\n }\n\n async createAndRenderChart () {\n const seatsio = await this.loadSeatsio()\n const config = this.extractConfigFromProps()\n config.container = this.container.current\n this.chart = this.createChart(seatsio, config).render()\n if (this.props.onRenderStarted) {\n this.props.onRenderStarted(this.chart)\n }\n }\n\n extractConfigFromProps (): any {\n let { chartJsUrl, divId, onRenderStarted, region, ...config } = this.props\n return config\n }\n\n componentWillUnmount () {\n this.destroyChart()\n }\n\n destroyChart () {\n if (this.chart && (this.chart as any).state !== 'DESTROYED') {\n this.chart.destroy()\n }\n }\n\n loadSeatsio (): Promise<Seatsio> {\n const chartUrl = this.getChartUrl()\n if (!Embeddable.seatsioBundles[chartUrl]) {\n Embeddable.seatsioBundles[chartUrl] = new Promise<Seatsio>((resolve, reject) => {\n const script = document.head.appendChild(document.createElement('script'))\n // Seatsio global is not replaced if already present, which would cause the wrong region bundle to resolve when changing region\n window.seatsio = undefined\n script.onload = () => {\n resolve(seatsio)\n }\n script.onerror = () => reject(`Could not load ${script.src}`)\n script.src = chartUrl\n })\n }\n\n return Embeddable.seatsioBundles[chartUrl]\n }\n\n render (): React.ReactNode {\n return (\n <div ref={this.container as unknown as React.RefObject<HTMLDivElement>} style={{'height': '100%', 'width': '100%'}} />\n )\n }\n}","import { BoothProps, GeneralAdmissionAreaProps, InteractiveObjectProps, InteractiveSectionProps, SeatProps, SelectableObjectProps, TableProps } from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObjectProps): obj is SeatProps => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObjectProps): obj is TableProps => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObjectProps): obj is InteractiveSectionProps => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObjectProps): obj is BoothProps => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObjectProps): obj is GeneralAdmissionAreaProps => obj.objectType === 'GeneralAdmiss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import {didPropsChange} from './util'\nimport { ChartDesigner, CommonConfigOptions, EventManager, Region, SeatingChart, Seatsio } from '@seatsio/seatsio-types'\n\nexport type EmbeddableProps<T > = {\n onRenderStarted?: (chart: SeatingChart | EventManager) => void\n chartJsUrl?: string\n region: Region\n} & T\n\nexport default abstract class Embeddable<T extends CommonConfigOptions> extends React.Component<EmbeddableProps<T>> {\n private container: React.RefObject<HTMLDivElement>\n private chart: SeatingChart\n private firstRender: boolean\n\n private static seatsioBundles: { [key: string]: Promise<Seatsio> } = {}\n\n static defaultProps = {\n chartJsUrl: 'https://cdn-{region}.seatsio.net/chart.js'\n }\n\n constructor(props: EmbeddableProps<T>) {\n super(props);\n this.container = React.createRef()\n this.firstRender = true\n }\n\n abstract createChart (seatsio: Seatsio, config: T): SeatingChart | EventManager | ChartDesigner\n\n componentDidMount () {\n if (!Embeddable.seatsioBundles[this.getChartUrl()] || this.firstRender) {\n this.createAndRenderChart()\n this.firstRender = false\n }\n }\n\n componentDidUpdate (prevProps: EmbeddableProps<T>) {\n if (didPropsChange(this.props, prevProps) && this.chart) {\n this.destroyChart()\n this.createAndRenderChart()\n }\n }\n\n getChartUrl () {\n return this.props.chartJsUrl.replace('{region}', this.props.region)\n }\n\n async createAndRenderChart () {\n const seatsio = await this.loadSeatsio()\n const config = this.extractConfigFromProps()\n config.container = this.container.current\n this.chart = this.createChart(seatsio, config).render()\n if (this.props.onRenderStarted) {\n this.props.onRenderStarted(this.chart)\n }\n }\n\n extractConfigFromProps (): any {\n let { chartJsUrl, divId, onRenderStarted, region, ...config } = this.props\n return config\n }\n\n componentWillUnmount () {\n this.destroyChart()\n }\n\n destroyChart () {\n if (this.chart && (this.chart as any).state !== 'DESTROYED') {\n this.chart.destroy()\n }\n }\n\n loadSeatsio (): Promise<Seatsio> {\n const chartUrl = this.getChartUrl()\n if (!Embeddable.seatsioBundles[chartUrl]) {\n Embeddable.seatsioBundles[chartUrl] = new Promise<Seatsio>((resolve, reject) => {\n const script = document.head.appendChild(document.createElement('script'))\n // Seatsio global is not replaced if already present, which would cause the wrong region bundle to resolve when changing region\n window.seatsio = undefined\n script.onload = () => {\n resolve(seatsio)\n }\n script.onerror = () => reject(`Could not load ${script.src}`)\n script.src = chartUrl\n })\n }\n\n return Embeddable.seatsioBundles[chartUrl]\n }\n\n render (): React.ReactNode {\n return (\n <div ref={this.container as unknown as React.RefObject<HTMLDivElement>} style={{'height': '100%', 'width': '100%'}} />\n )\n }\n}","import {Booth, GeneralAdmissionArea, InteractiveSection, Seat, SelectableObject, Table} from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObject) => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObject): obj is Table => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObject): obj is InteractiveSection => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObject): obj is Booth => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObject): obj is GeneralAdmissionArea => obj.objectType === 'GeneralAdmissionArea'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAAuB;;;ACEhB,IAAM,iBAAiB,CAAkC,WAAc,cAA0B;AACpG,MAAI,OAAO,KAAK,SAAS,EAAE,WAAW,OAAO,KAAK,SAAS,EAAE,QAAQ;AACjE,WAAO;AAAA,EACX;AACA,SAAO,OAAO,KAAK,SAAS,EAAE,KAA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AG,OAAO,IAAI,KAAK;AACrE,WAAO;AAAA,EACX;AAAA,EAEA,uBAAwB;AACpB,SAAK,aAAa;AAAA,EACtB;AAAA,EAEA,eAAgB;AACZ,QAAI,KAAK,SAAU,KAAK,MAAc,UAAU,aAAa;AACzD,WAAK,MAAM,QAAQ;AAAA,IACvB;AAAA,EACJ;AAAA,EAEA,cAAiC;AAC7B,UAAM,WAAW,KAAK,YAAY;AAClC,QAAI,CAAC,YAAW,eAAe,QAAQ,GAAG;AACtC,kBAAW,eAAe,QAAQ,IAAI,IAAI,QAAiB,CAAC,SAAS,WAAW;AAC5E,cAAM,SAAS,SAAS,KAAK,YAAY,SAAS,cAAc,QAAQ,CAAC;AAEzE,eAAO,UAAU;AACjB,eAAO,SAAS,MAAM;AAClB,kBAAQ,OAAO;AAAA,QACnB;AACA,eAAO,UAAU,MAAM,OAAO,kBAAkB,OAAO,GAAG,EAAE;AAC5D,eAAO,MAAM;AAAA,MACjB,CAAC;AAAA,IACL;AAEA,WAAO,YAAW,eAAe,QAAQ;AAAA,EAC7C;AAAA,EAEA,SAA2B;AACvB,WACI,oCAAC,SAAI,KAAK,KAAK,WAAyD,OAAO,EAAC,UAAU,QAAQ,SAAS,OAAM,GAAG;AAAA,EAE5H;AACJ;AArF8B,YAKX,iBAAsD,CAAC;AAL5C,YAOnB,eAAe;AAAA,EAClB,YAAY;AAChB;AATJ,IAA8B,aAA9B;","names":["seatsio"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/main/Embeddable.tsx","../src/main/util.ts"],"sourcesContent":["import * as React from 'react'\nimport {didPropsChange} from './util'\nimport { ChartDesigner, CommonConfigOptions, EventManager, Region, SeatingChart, Seatsio } from '@seatsio/seatsio-types'\n\nexport type EmbeddableProps<T > = {\n onRenderStarted?: (chart: SeatingChart | EventManager) => void\n chartJsUrl?: string\n region: Region\n} & T\n\nexport default abstract class Embeddable<T extends CommonConfigOptions> extends React.Component<EmbeddableProps<T>> {\n private container: React.RefObject<HTMLDivElement>\n private chart: SeatingChart\n private firstRender: boolean\n\n private static seatsioBundles: { [key: string]: Promise<Seatsio> } = {}\n\n static defaultProps = {\n chartJsUrl: 'https://cdn-{region}.seatsio.net/chart.js'\n }\n\n constructor(props: EmbeddableProps<T>) {\n super(props);\n this.container = React.createRef()\n this.firstRender = true\n }\n\n abstract createChart (seatsio: Seatsio, config: T): SeatingChart | EventManager | ChartDesigner\n\n componentDidMount () {\n if (!Embeddable.seatsioBundles[this.getChartUrl()] || this.firstRender) {\n this.createAndRenderChart()\n this.firstRender = false\n }\n }\n\n componentDidUpdate (prevProps: EmbeddableProps<T>) {\n if (didPropsChange(this.props, prevProps) && this.chart) {\n this.destroyChart()\n this.createAndRenderChart()\n }\n }\n\n getChartUrl () {\n return this.props.chartJsUrl.replace('{region}', this.props.region)\n }\n\n async createAndRenderChart () {\n const seatsio = await this.loadSeatsio()\n const config = this.extractConfigFromProps()\n config.container = this.container.current\n this.chart = this.createChart(seatsio, config).render()\n if (this.props.onRenderStarted) {\n this.props.onRenderStarted(this.chart)\n }\n }\n\n extractConfigFromProps (): any {\n let { chartJsUrl, divId, onRenderStarted, region, ...config } = this.props\n return config\n }\n\n componentWillUnmount () {\n this.destroyChart()\n }\n\n destroyChart () {\n if (this.chart && (this.chart as any).state !== 'DESTROYED') {\n this.chart.destroy()\n }\n }\n\n loadSeatsio (): Promise<Seatsio> {\n const chartUrl = this.getChartUrl()\n if (!Embeddable.seatsioBundles[chartUrl]) {\n Embeddable.seatsioBundles[chartUrl] = new Promise<Seatsio>((resolve, reject) => {\n const script = document.head.appendChild(document.createElement('script'))\n // Seatsio global is not replaced if already present, which would cause the wrong region bundle to resolve when changing region\n window.seatsio = undefined\n script.onload = () => {\n resolve(seatsio)\n }\n script.onerror = () => reject(`Could not load ${script.src}`)\n script.src = chartUrl\n })\n }\n\n return Embeddable.seatsioBundles[chartUrl]\n }\n\n render (): React.ReactNode {\n return (\n <div ref={this.container as unknown as React.RefObject<HTMLDivElement>} style={{'height': '100%', 'width': '100%'}} />\n )\n }\n}","import { BoothProps, GeneralAdmissionAreaProps, InteractiveObjectProps, InteractiveSectionProps, SeatProps, SelectableObjectProps, TableProps } from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObjectProps): obj is SeatProps => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObjectProps): obj is TableProps => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObjectProps): obj is InteractiveSectionProps => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObjectProps): obj is BoothProps => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObjectProps): obj is GeneralAdmissionAreaProps => obj.objectType === 'GeneralAdmissionArea'"],"mappings":";AAAA,YAAY,WAAW;;;ACEhB,IAAM,iBAAiB,CAAkC,WAAc,cAA0B;AACpG,MAAI,OAAO,KAAK,SAAS,EAAE,WAAW,OAAO,KAAK,SAAS,EAAE,QAAQ;AACjE,WAAO;AAAA,EACX;AACA,SAAO,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,aAAqB;AACrD,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,aAAa,WAAW;AACxB,UAAI,OAAO,cAAc,cAAc,OAAO,cAAc,YAAY;AACpE,eAAO,UAAU,SAAS,MAAM,UAAU,SAAS;AAAA,MACvD;AACA,UAAI,OAAO,cAAc,YAAY,OAAO,cAAc,UA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W,KAAK,YAAY;AAClC,QAAI,CAAC,YAAW,eAAe,QAAQ,GAAG;AACtC,kBAAW,eAAe,QAAQ,IAAI,IAAI,QAAiB,CAAC,SAAS,WAAW;AAC5E,cAAM,SAAS,SAAS,KAAK,YAAY,SAAS,cAAc,QAAQ,CAAC;AAEzE,eAAO,UAAU;AACjB,eAAO,SAAS,MAAM;AAClB,kBAAQ,OAAO;AAAA,QACnB;AACA,eAAO,UAAU,MAAM,OAAO,kBAAkB,OAAO,GAAG,EAAE;AAC5D,eAAO,MAAM;AAAA,MACjB,CAAC;AAAA,IACL;AAEA,WAAO,YAAW,eAAe,QAAQ;AAAA,EAC7C;AAAA,EAEA,SAA2B;AACvB,WACI,oCAAC,SAAI,KAAK,KAAK,WAAyD,OAAO,EAAC,UAAU,QAAQ,SAAS,OAAM,GAAG;AAAA,EAE5H;AACJ;AArF8B,YAKX,iBAAsD,CAAC;AAL5C,YAOnB,eAAe;AAAA,EAClB,YAAY;AAChB;AATJ,IAA8B,aAA9B;","names":["seatsio"]}
1
+ {"version":3,"sources":["../src/main/Embeddable.tsx","../src/main/util.ts"],"sourcesContent":["import * as React from 'react'\nimport {didPropsChange} from './util'\nimport { ChartDesigner, CommonConfigOptions, EventManager, Region, SeatingChart, Seatsio } from '@seatsio/seatsio-types'\n\nexport type EmbeddableProps<T > = {\n onRenderStarted?: (chart: SeatingChart | EventManager) => void\n chartJsUrl?: string\n region: Region\n} & T\n\nexport default abstract class Embeddable<T extends CommonConfigOptions> extends React.Component<EmbeddableProps<T>> {\n private container: React.RefObject<HTMLDivElement>\n private chart: SeatingChart\n private firstRender: boolean\n\n private static seatsioBundles: { [key: string]: Promise<Seatsio> } = {}\n\n static defaultProps = {\n chartJsUrl: 'https://cdn-{region}.seatsio.net/chart.js'\n }\n\n constructor(props: EmbeddableProps<T>) {\n super(props);\n this.container = React.createRef()\n this.firstRender = true\n }\n\n abstract createChart (seatsio: Seatsio, config: T): SeatingChart | EventManager | ChartDesigner\n\n componentDidMount () {\n if (!Embeddable.seatsioBundles[this.getChartUrl()] || this.firstRender) {\n this.createAndRenderChart()\n this.firstRender = false\n }\n }\n\n componentDidUpdate (prevProps: EmbeddableProps<T>) {\n if (didPropsChange(this.props, prevProps) && this.chart) {\n this.destroyChart()\n this.createAndRenderChart()\n }\n }\n\n getChartUrl () {\n return this.props.chartJsUrl.replace('{region}', this.props.region)\n }\n\n async createAndRenderChart () {\n const seatsio = await this.loadSeatsio()\n const config = this.extractConfigFromProps()\n config.container = this.container.current\n this.chart = this.createChart(seatsio, config).render()\n if (this.props.onRenderStarted) {\n this.props.onRenderStarted(this.chart)\n }\n }\n\n extractConfigFromProps (): any {\n let { chartJsUrl, divId, onRenderStarted, region, ...config } = this.props\n return config\n }\n\n componentWillUnmount () {\n this.destroyChart()\n }\n\n destroyChart () {\n if (this.chart && (this.chart as any).state !== 'DESTROYED') {\n this.chart.destroy()\n }\n }\n\n loadSeatsio (): Promise<Seatsio> {\n const chartUrl = this.getChartUrl()\n if (!Embeddable.seatsioBundles[chartUrl]) {\n Embeddable.seatsioBundles[chartUrl] = new Promise<Seatsio>((resolve, reject) => {\n const script = document.head.appendChild(document.createElement('script'))\n // Seatsio global is not replaced if already present, which would cause the wrong region bundle to resolve when changing region\n window.seatsio = undefined\n script.onload = () => {\n resolve(seatsio)\n }\n script.onerror = () => reject(`Could not load ${script.src}`)\n script.src = chartUrl\n })\n }\n\n return Embeddable.seatsioBundles[chartUrl]\n }\n\n render (): React.ReactNode {\n return (\n <div ref={this.container as unknown as React.RefObject<HTMLDivElement>} style={{'height': '100%', 'width': '100%'}} />\n )\n }\n}","import {Booth, GeneralAdmissionArea, InteractiveSection, Seat, SelectableObject, Table} from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObject) => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObject): obj is Table => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObject): obj is InteractiveSection => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObject): obj is Booth => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObject): obj is GeneralAdmissionArea => obj.objectType === 'GeneralAdmissionArea'\n"],"mappings":";AAAA,YAAY,WAAW;;;ACEhB,IAAM,iBAAiB,CAAkC,WAAc,cAA0B;AACpG,MAAI,OAAO,KAAK,SAAS,EAAE,WAAW,OAAO,KAAK,SAAS,EAAE,QAAQ;AACjE,WAAO;AAAA,EACX;AACA,SAAO,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,aAAqB;AACrD,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,aAAa,WAAW;AACxB,UAAI,OAAO,cAAc,cAAc,OAAO,cAAc,YAAY;AACpE,eAAO,UAAU,SAAS,MAAM,UAAU,SAAS;AAAA,MACvD;AACA,UAAI,OAAO,cAAc,YAAY,OAAO,cAAc,UAAU;AAChE,eAAO,eAAe,WAAW,SAAS;AAAA,MAC9C;AAAA,IACJ;AACA,WAAO,cAAc;AAAA,EACzB,CAAC;AACL;;;ADTA,IAA8B,cAA9B,MAA8B,oBAAwD,gBAA8B;AAAA,EAWhH,YAAY,OAA2B;AACnC,UAAM,KAAK;AACX,SAAK,YAAkB,gBAAU;AACjC,SAAK,cAAc;AAAA,EACvB;AAAA,EAIA,oBAAqB;AACjB,QAAI,CAAC,YAAW,eAAe,KAAK,YAAY,CAAC,KAAK,KAAK,aAA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AAM;AAAA,MACjB,CAAC;AAAA,IACL;AAEA,WAAO,YAAW,eAAe,QAAQ;AAAA,EAC7C;AAAA,EAEA,SAA2B;AACvB,WACI,oCAAC,SAAI,KAAK,KAAK,WAAyD,OAAO,EAAC,UAAU,QAAQ,SAAS,OAAM,GAAG;AAAA,EAE5H;AACJ;AArF8B,YAKX,iBAAsD,CAAC;AAL5C,YAOnB,eAAe;AAAA,EAClB,YAAY;AAChB;AATJ,IAA8B,aAA9B;","names":["seatsio"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/main/SeatsioDesigner.tsx","../src/main/Embeddable.tsx","../src/main/util.ts"],"sourcesContent":["import Embeddable from './Embeddable'\nimport { ChartDesignerConfigOptions, Seatsio } from '@seatsio/seatsio-types'\n\nexport default class SeatsioDesigner extends Embeddable<ChartDesignerConfigOptions> {\n createChart (seatsio: Seatsio, config: ChartDesignerConfigOptions) {\n return new seatsio.SeatingChartDesigner(config)\n }\n}","import * as React from 'react'\nimport {didPropsChange} from './util'\nimport { ChartDesigner, CommonConfigOptions, EventManager, Region, SeatingChart, Seatsio } from '@seatsio/seatsio-types'\n\nexport type EmbeddableProps<T > = {\n onRenderStarted?: (chart: SeatingChart | EventManager) => void\n chartJsUrl?: string\n region: Region\n} & T\n\nexport default abstract class Embeddable<T extends CommonConfigOptions> extends React.Component<EmbeddableProps<T>> {\n private container: React.RefObject<HTMLDivElement>\n private chart: SeatingChart\n private firstRender: boolean\n\n private static seatsioBundles: { [key: string]: Promise<Seatsio> } = {}\n\n static defaultProps = {\n chartJsUrl: 'https://cdn-{region}.seatsio.net/chart.js'\n }\n\n constructor(props: EmbeddableProps<T>) {\n super(props);\n this.container = React.createRef()\n this.firstRender = true\n }\n\n abstract createChart (seatsio: Seatsio, config: T): SeatingChart | EventManager | ChartDesigner\n\n componentDidMount () {\n if (!Embeddable.seatsioBundles[this.getChartUrl()] || this.firstRender) {\n this.createAndRenderChart()\n this.firstRender = false\n }\n }\n\n componentDidUpdate (prevProps: EmbeddableProps<T>) {\n if (didPropsChange(this.props, prevProps) && this.chart) {\n this.destroyChart()\n this.createAndRenderChart()\n }\n }\n\n getChartUrl () {\n return this.props.chartJsUrl.replace('{region}', this.props.region)\n }\n\n async createAndRenderChart () {\n const seatsio = await this.loadSeatsio()\n const config = this.extractConfigFromProps()\n config.container = this.container.current\n this.chart = this.createChart(seatsio, config).render()\n if (this.props.onRenderStarted) {\n this.props.onRenderStarted(this.chart)\n }\n }\n\n extractConfigFromProps (): any {\n let { chartJsUrl, divId, onRenderStarted, region, ...config } = this.props\n return config\n }\n\n componentWillUnmount () {\n this.destroyChart()\n }\n\n destroyChart () {\n if (this.chart && (this.chart as any).state !== 'DESTROYED') {\n this.chart.destroy()\n }\n }\n\n loadSeatsio (): Promise<Seatsio> {\n const chartUrl = this.getChartUrl()\n if (!Embeddable.seatsioBundles[chartUrl]) {\n Embeddable.seatsioBundles[chartUrl] = new Promise<Seatsio>((resolve, reject) => {\n const script = document.head.appendChild(document.createElement('script'))\n // Seatsio global is not replaced if already present, which would cause the wrong region bundle to resolve when changing region\n window.seatsio = undefined\n script.onload = () => {\n resolve(seatsio)\n }\n script.onerror = () => reject(`Could not load ${script.src}`)\n script.src = chartUrl\n })\n }\n\n return Embeddable.seatsioBundles[chartUrl]\n }\n\n render (): React.ReactNode {\n return (\n <div ref={this.container as unknown as React.RefObject<HTMLDivElement>} style={{'height': '100%', 'width': '100%'}} />\n )\n }\n}","import { BoothProps, GeneralAdmissionAreaProps, InteractiveObjectProps, InteractiveSectionProps, SeatProps, SelectableObjectProps, TableProps } from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObjectProps): obj is SeatProps => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObjectProps): obj is TableProps => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObjectProps): obj is InteractiveSectionProps => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObjectProps): obj is BoothProps => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObjectProps): obj is GeneralAdmissionAreaProps => obj.objectType === 'GeneralAdmissionArea'"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;;;ACEhB,IAAM,iBAAiB,CAAkC,WAAc,cAA0B;AACpG,MAAI,OAAO,KAAK,SAAS,EAAE,WAAW,OAAO,KAAK,SAAS,EAAE,QAAQ;AACjE,WAAO;AAAA,EACX;AACA,SAAO,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,aAAqB;AACrD,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,aAAa,WAAW;AACxB,UAAI,OAAO,cAAc,cAAc,OAAO,cAAc,YAAY;AACpE,eAAO,UAAU,SAAS,MAAM,UAAU,SAAS;AAAA,MACvD;AACA,UAAI,OAAO,cAAc,YAAY,OAAO,cAAc,UAAU;AAChE,eAAO,eAAe,WAAW,SAAS;AAAA,MAC9C;AAAA,IACJ;AACA,WAAO,cAAc;AAAA,EACzB,CAAC;AACL;;;ADTA,IAA8B,cAA9B,MAA8B,oBAAwD,gBAA8B;AAAA,EAWhH,YAAY,OAA2B;AACnC,UAAM,KAAK;AACX,SAAK,YAAkB,gBAAU;AACjC,SAAK,cAAc;AAAA,EACvB;AAAA,EAIA,oBAAqB;AACjB,QAAI,CAAC,YAAW,eAAe,KAAK,YA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AAG,EAAE;AAC5D,eAAO,MAAM;AAAA,MACjB,CAAC;AAAA,IACL;AAEA,WAAO,YAAW,eAAe,QAAQ;AAAA,EAC7C;AAAA,EAEA,SAA2B;AACvB,WACI,oCAAC,SAAI,KAAK,KAAK,WAAyD,OAAO,EAAC,UAAU,QAAQ,SAAS,OAAM,GAAG;AAAA,EAE5H;AACJ;AArF8B,YAKX,iBAAsD,CAAC;AAL5C,YAOnB,eAAe;AAAA,EAClB,YAAY;AAChB;AATJ,IAA8B,aAA9B;;;ADPA,IAAqB,kBAArB,cAA6C,WAAuC;AAAA,EAChF,YAAaC,UAAkB,QAAoC;AAC/D,WAAO,IAAIA,SAAQ,qBAAqB,MAAM;AAAA,EAClD;AACJ;","names":["seatsio","seatsio"]}
1
+ {"version":3,"sources":["../src/main/SeatsioDesigner.tsx","../src/main/Embeddable.tsx","../src/main/util.ts"],"sourcesContent":["import Embeddable from './Embeddable'\nimport { ChartDesignerConfigOptions, Seatsio } from '@seatsio/seatsio-types'\n\nexport default class SeatsioDesigner extends Embeddable<ChartDesignerConfigOptions> {\n createChart (seatsio: Seatsio, config: ChartDesignerConfigOptions) {\n return new seatsio.SeatingChartDesigner(config)\n }\n}","import * as React from 'react'\nimport {didPropsChange} from './util'\nimport { ChartDesigner, CommonConfigOptions, EventManager, Region, SeatingChart, Seatsio } from '@seatsio/seatsio-types'\n\nexport type EmbeddableProps<T > = {\n onRenderStarted?: (chart: SeatingChart | EventManager) => void\n chartJsUrl?: string\n region: Region\n} & T\n\nexport default abstract class Embeddable<T extends CommonConfigOptions> extends React.Component<EmbeddableProps<T>> {\n private container: React.RefObject<HTMLDivElement>\n private chart: SeatingChart\n private firstRender: boolean\n\n private static seatsioBundles: { [key: string]: Promise<Seatsio> } = {}\n\n static defaultProps = {\n chartJsUrl: 'https://cdn-{region}.seatsio.net/chart.js'\n }\n\n constructor(props: EmbeddableProps<T>) {\n super(props);\n this.container = React.createRef()\n this.firstRender = true\n }\n\n abstract createChart (seatsio: Seatsio, config: T): SeatingChart | EventManager | ChartDesigner\n\n componentDidMount () {\n if (!Embeddable.seatsioBundles[this.getChartUrl()] || this.firstRender) {\n this.createAndRenderChart()\n this.firstRender = false\n }\n }\n\n componentDidUpdate (prevProps: EmbeddableProps<T>) {\n if (didPropsChange(this.props, prevProps) && this.chart) {\n this.destroyChart()\n this.createAndRenderChart()\n }\n }\n\n getChartUrl () {\n return this.props.chartJsUrl.replace('{region}', this.props.region)\n }\n\n async createAndRenderChart () {\n const seatsio = await this.loadSeatsio()\n const config = this.extractConfigFromProps()\n config.container = this.container.current\n this.chart = this.createChart(seatsio, config).render()\n if (this.props.onRenderStarted) {\n this.props.onRenderStarted(this.chart)\n }\n }\n\n extractConfigFromProps (): any {\n let { chartJsUrl, divId, onRenderStarted, region, ...config } = this.props\n return config\n }\n\n componentWillUnmount () {\n this.destroyChart()\n }\n\n destroyChart () {\n if (this.chart && (this.chart as any).state !== 'DESTROYED') {\n this.chart.destroy()\n }\n }\n\n loadSeatsio (): Promise<Seatsio> {\n const chartUrl = this.getChartUrl()\n if (!Embeddable.seatsioBundles[chartUrl]) {\n Embeddable.seatsioBundles[chartUrl] = new Promise<Seatsio>((resolve, reject) => {\n const script = document.head.appendChild(document.createElement('script'))\n // Seatsio global is not replaced if already present, which would cause the wrong region bundle to resolve when changing region\n window.seatsio = undefined\n script.onload = () => {\n resolve(seatsio)\n }\n script.onerror = () => reject(`Could not load ${script.src}`)\n script.src = chartUrl\n })\n }\n\n return Embeddable.seatsioBundles[chartUrl]\n }\n\n render (): React.ReactNode {\n return (\n <div ref={this.container as unknown as React.RefObject<HTMLDivElement>} style={{'height': '100%', 'width': '100%'}} />\n )\n }\n}","import {Booth, GeneralAdmissionArea, InteractiveSection, Seat, SelectableObject, Table} from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObject) => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObject): obj is Table => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObject): obj is InteractiveSection => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObject): obj is Booth => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObject): obj is GeneralAdmissionArea => obj.objectType === 'GeneralAdmissionArea'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;;;ACEhB,IAAM,iBAAiB,CAAkC,WAAc,cAA0B;AACpG,MAAI,OAAO,KAAK,SAAS,EAAE,WAAW,OAAO,KAAK,SAAS,EAAE,QAAQ;AACjE,WAAO;AAAA,EACX;AACA,SAAO,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,aAAqB;AACrD,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,aAAa,WAAW;AACxB,UAAI,OAAO,cAAc,cAAc,OAAO,cAAc,YAAY;AACpE,eAAO,UAAU,SAAS,MAAM,UAAU,SAAS;AAAA,MACvD;AACA,UAAI,OAAO,cAAc,YAAY,OAAO,cAAc,UAAU;AAChE,eAAO,eAAe,WAAW,SAAS;AAAA,MAC9C;AAAA,IACJ;AACA,WAAO,cAAc;AAAA,EACzB,CAAC;AACL;;;ADTA,IAA8B,cAA9B,MAA8B,oBAAwD,gBAA8B;AAAA,EAWhH,YAAY,OAA2B;AACnC,UAAM,KAAK;AACX,SAAK,YAAkB,gBAAU;AACjC,SA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AM;AAClB,kBAAQ,OAAO;AAAA,QACnB;AACA,eAAO,UAAU,MAAM,OAAO,kBAAkB,OAAO,GAAG,EAAE;AAC5D,eAAO,MAAM;AAAA,MACjB,CAAC;AAAA,IACL;AAEA,WAAO,YAAW,eAAe,QAAQ;AAAA,EAC7C;AAAA,EAEA,SAA2B;AACvB,WACI,oCAAC,SAAI,KAAK,KAAK,WAAyD,OAAO,EAAC,UAAU,QAAQ,SAAS,OAAM,GAAG;AAAA,EAE5H;AACJ;AArF8B,YAKX,iBAAsD,CAAC;AAL5C,YAOnB,eAAe;AAAA,EAClB,YAAY;AAChB;AATJ,IAA8B,aAA9B;;;ADPA,IAAqB,kBAArB,cAA6C,WAAuC;AAAA,EAChF,YAAaC,UAAkB,QAAoC;AAC/D,WAAO,IAAIA,SAAQ,qBAAqB,MAAM;AAAA,EAClD;AACJ;","names":["seatsio","seatsio"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/main/Embeddable.tsx","../src/main/util.ts","../src/main/SeatsioDesigner.tsx"],"sourcesContent":["import * as React from 'react'\nimport {didPropsChange} from './util'\nimport { ChartDesigner, CommonConfigOptions, EventManager, Region, SeatingChart, Seatsio } from '@seatsio/seatsio-types'\n\nexport type EmbeddableProps<T > = {\n onRenderStarted?: (chart: SeatingChart | EventManager) => void\n chartJsUrl?: string\n region: Region\n} & T\n\nexport default abstract class Embeddable<T extends CommonConfigOptions> extends React.Component<EmbeddableProps<T>> {\n private container: React.RefObject<HTMLDivElement>\n private chart: SeatingChart\n private firstRender: boolean\n\n private static seatsioBundles: { [key: string]: Promise<Seatsio> } = {}\n\n static defaultProps = {\n chartJsUrl: 'https://cdn-{region}.seatsio.net/chart.js'\n }\n\n constructor(props: EmbeddableProps<T>) {\n super(props);\n this.container = React.createRef()\n this.firstRender = true\n }\n\n abstract createChart (seatsio: Seatsio, config: T): SeatingChart | EventManager | ChartDesigner\n\n componentDidMount () {\n if (!Embeddable.seatsioBundles[this.getChartUrl()] || this.firstRender) {\n this.createAndRenderChart()\n this.firstRender = false\n }\n }\n\n componentDidUpdate (prevProps: EmbeddableProps<T>) {\n if (didPropsChange(this.props, prevProps) && this.chart) {\n this.destroyChart()\n this.createAndRenderChart()\n }\n }\n\n getChartUrl () {\n return this.props.chartJsUrl.replace('{region}', this.props.region)\n }\n\n async createAndRenderChart () {\n const seatsio = await this.loadSeatsio()\n const config = this.extractConfigFromProps()\n config.container = this.container.current\n this.chart = this.createChart(seatsio, config).render()\n if (this.props.onRenderStarted) {\n this.props.onRenderStarted(this.chart)\n }\n }\n\n extractConfigFromProps (): any {\n let { chartJsUrl, divId, onRenderStarted, region, ...config } = this.props\n return config\n }\n\n componentWillUnmount () {\n this.destroyChart()\n }\n\n destroyChart () {\n if (this.chart && (this.chart as any).state !== 'DESTROYED') {\n this.chart.destroy()\n }\n }\n\n loadSeatsio (): Promise<Seatsio> {\n const chartUrl = this.getChartUrl()\n if (!Embeddable.seatsioBundles[chartUrl]) {\n Embeddable.seatsioBundles[chartUrl] = new Promise<Seatsio>((resolve, reject) => {\n const script = document.head.appendChild(document.createElement('script'))\n // Seatsio global is not replaced if already present, which would cause the wrong region bundle to resolve when changing region\n window.seatsio = undefined\n script.onload = () => {\n resolve(seatsio)\n }\n script.onerror = () => reject(`Could not load ${script.src}`)\n script.src = chartUrl\n })\n }\n\n return Embeddable.seatsioBundles[chartUrl]\n }\n\n render (): React.ReactNode {\n return (\n <div ref={this.container as unknown as React.RefObject<HTMLDivElement>} style={{'height': '100%', 'width': '100%'}} />\n )\n }\n}","import { BoothProps, GeneralAdmissionAreaProps, InteractiveObjectProps, InteractiveSectionProps, SeatProps, SelectableObjectProps, TableProps } from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObjectProps): obj is SeatProps => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObjectProps): obj is TableProps => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObjectProps): obj is InteractiveSectionProps => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObjectProps): obj is BoothProps => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObjectProps): obj is GeneralAdmissionAreaProps => obj.objectType === 'GeneralAdmissionArea'","import Embeddable from './Embeddable'\nimport { ChartDesignerConfigOptions, Seatsio } from '@seatsio/seatsio-types'\n\nexport default class SeatsioDesigner extends Embeddable<ChartDesignerConfigOptions> {\n createChart (seatsio: Seatsio, config: ChartDesignerConfigOptions) {\n return new seatsio.SeatingChartDesigner(config)\n }\n}"],"mappings":";AAAA,YAAY,WAAW;;;ACEhB,IAAM,iBAAiB,CAAkC,WAAc,cAA0B;AACpG,MAAI,OAAO,KAAK,SAAS,EAAE,WAAW,OAAO,KAAK,SAAS,EAAE,QAAQ;AACjE,WAAO;AAAA,EACX;AACA,SAAO,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,aAAqB;AACrD,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,aAAa,WAAW;AACxB,UAAI,OAAO,cAAc,cAAc,OAAO,cAAc,YAAY;AACpE,eAAO,UAAU,SAAS,MAAM,UAAU,SAAS;AAAA,MACvD;AACA,UAAI,OAAO,cAAc,YAAY,OAAO,cAAc,UAAU;AAChE,eAAO,eAAe,WAAW,SAAS;AAAA,MAC9C;AAAA,IACJ;AACA,WAAO,cAAc;AAAA,EACzB,CAAC;AACL;;;ADTA,IAA8B,cAA9B,M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AC5E,cAAM,SAAS,SAAS,KAAK,YAAY,SAAS,cAAc,QAAQ,CAAC;AAEzE,eAAO,UAAU;AACjB,eAAO,SAAS,MAAM;AAClB,kBAAQ,OAAO;AAAA,QACnB;AACA,eAAO,UAAU,MAAM,OAAO,kBAAkB,OAAO,GAAG,EAAE;AAC5D,eAAO,MAAM;AAAA,MACjB,CAAC;AAAA,IACL;AAEA,WAAO,YAAW,eAAe,QAAQ;AAAA,EAC7C;AAAA,EAEA,SAA2B;AACvB,WACI,oCAAC,SAAI,KAAK,KAAK,WAAyD,OAAO,EAAC,UAAU,QAAQ,SAAS,OAAM,GAAG;AAAA,EAE5H;AACJ;AArF8B,YAKX,iBAAsD,CAAC;AAL5C,YAOnB,eAAe;AAAA,EAClB,YAAY;AAChB;AATJ,IAA8B,aAA9B;;;AEPA,IAAqB,kBAArB,cAA6C,WAAuC;AAAA,EAChF,YAAaC,UAAkB,QAAoC;AAC/D,WAAO,IAAIA,SAAQ,qBAAqB,MAAM;AAAA,EAClD;AACJ;","names":["seatsio","seatsio"]}
1
+ {"version":3,"sources":["../src/main/Embeddable.tsx","../src/main/util.ts","../src/main/SeatsioDesigner.tsx"],"sourcesContent":["import * as React from 'react'\nimport {didPropsChange} from './util'\nimport { ChartDesigner, CommonConfigOptions, EventManager, Region, SeatingChart, Seatsio } from '@seatsio/seatsio-types'\n\nexport type EmbeddableProps<T > = {\n onRenderStarted?: (chart: SeatingChart | EventManager) => void\n chartJsUrl?: string\n region: Region\n} & T\n\nexport default abstract class Embeddable<T extends CommonConfigOptions> extends React.Component<EmbeddableProps<T>> {\n private container: React.RefObject<HTMLDivElement>\n private chart: SeatingChart\n private firstRender: boolean\n\n private static seatsioBundles: { [key: string]: Promise<Seatsio> } = {}\n\n static defaultProps = {\n chartJsUrl: 'https://cdn-{region}.seatsio.net/chart.js'\n }\n\n constructor(props: EmbeddableProps<T>) {\n super(props);\n this.container = React.createRef()\n this.firstRender = true\n }\n\n abstract createChart (seatsio: Seatsio, config: T): SeatingChart | EventManager | ChartDesigner\n\n componentDidMount () {\n if (!Embeddable.seatsioBundles[this.getChartUrl()] || this.firstRender) {\n this.createAndRenderChart()\n this.firstRender = false\n }\n }\n\n componentDidUpdate (prevProps: EmbeddableProps<T>) {\n if (didPropsChange(this.props, prevProps) && this.chart) {\n this.destroyChart()\n this.createAndRenderChart()\n }\n }\n\n getChartUrl () {\n return this.props.chartJsUrl.replace('{region}', this.props.region)\n }\n\n async createAndRenderChart () {\n const seatsio = await this.loadSeatsio()\n const config = this.extractConfigFromProps()\n config.container = this.container.current\n this.chart = this.createChart(seatsio, config).render()\n if (this.props.onRenderStarted) {\n this.props.onRenderStarted(this.chart)\n }\n }\n\n extractConfigFromProps (): any {\n let { chartJsUrl, divId, onRenderStarted, region, ...config } = this.props\n return config\n }\n\n componentWillUnmount () {\n this.destroyChart()\n }\n\n destroyChart () {\n if (this.chart && (this.chart as any).state !== 'DESTROYED') {\n this.chart.destroy()\n }\n }\n\n loadSeatsio (): Promise<Seatsio> {\n const chartUrl = this.getChartUrl()\n if (!Embeddable.seatsioBundles[chartUrl]) {\n Embeddable.seatsioBundles[chartUrl] = new Promise<Seatsio>((resolve, reject) => {\n const script = document.head.appendChild(document.createElement('script'))\n // Seatsio global is not replaced if already present, which would cause the wrong region bundle to resolve when changing region\n window.seatsio = undefined\n script.onload = () => {\n resolve(seatsio)\n }\n script.onerror = () => reject(`Could not load ${script.src}`)\n script.src = chartUrl\n })\n }\n\n return Embeddable.seatsioBundles[chartUrl]\n }\n\n render (): React.ReactNode {\n return (\n <div ref={this.container as unknown as React.RefObject<HTMLDivElement>} style={{'height': '100%', 'width': '100%'}} />\n )\n }\n}","import {Booth, GeneralAdmissionArea, InteractiveSection, Seat, SelectableObject, Table} from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObject) => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObject): obj is Table => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObject): obj is InteractiveSection => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObject): obj is Booth => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObject): obj is GeneralAdmissionArea => obj.objectType === 'GeneralAdmissionArea'\n","import Embeddable from './Embeddable'\nimport { ChartDesignerConfigOptions, Seatsio } from '@seatsio/seatsio-types'\n\nexport default class SeatsioDesigner extends Embeddable<ChartDesignerConfigOptions> {\n createChart (seatsio: Seatsio, config: ChartDesignerConfigOptions) {\n return new seatsio.SeatingChartDesigner(config)\n }\n}"],"mappings":";AAAA,YAAY,WAAW;;;ACEhB,IAAM,iBAAiB,CAAkC,WAAc,cAA0B;AACpG,MAAI,OAAO,KAAK,SAAS,EAAE,WAAW,OAAO,KAAK,SAAS,EAAE,QAAQ;AACjE,WAAO;AAAA,EACX;AACA,SAAO,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,aAAqB;AACrD,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,aAAa,WAAW;AACxB,UAAI,OAAO,cAAc,cAAc,OAAO,cAAc,YAAY;AACpE,eAAO,UAAU,SAAS,MAAM,UAAU,SAAS;AAAA,MACvD;AACA,UAAI,OAAO,cAAc,YAAY,OAAO,cAAc,UAAU;AAChE,eAAO,eAAe,WAAW,SAAS;AAAA,MAC9C;AAAA,IACJ;AACA,WAAO,cAAc;AAAA,EACzB,CAAC;AACL;;;AD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CAAC,SAAS,WAAW;AAC5E,cAAM,SAAS,SAAS,KAAK,YAAY,SAAS,cAAc,QAAQ,CAAC;AAEzE,eAAO,UAAU;AACjB,eAAO,SAAS,MAAM;AAClB,kBAAQ,OAAO;AAAA,QACnB;AACA,eAAO,UAAU,MAAM,OAAO,kBAAkB,OAAO,GAAG,EAAE;AAC5D,eAAO,MAAM;AAAA,MACjB,CAAC;AAAA,IACL;AAEA,WAAO,YAAW,eAAe,QAAQ;AAAA,EAC7C;AAAA,EAEA,SAA2B;AACvB,WACI,oCAAC,SAAI,KAAK,KAAK,WAAyD,OAAO,EAAC,UAAU,QAAQ,SAAS,OAAM,GAAG;AAAA,EAE5H;AACJ;AArF8B,YAKX,iBAAsD,CAAC;AAL5C,YAOnB,eAAe;AAAA,EAClB,YAAY;AAChB;AATJ,IAA8B,aAA9B;;;AEPA,IAAqB,kBAArB,cAA6C,WAAuC;AAAA,EAChF,YAAaC,UAAkB,QAAoC;AAC/D,WAAO,IAAIA,SAAQ,qBAAqB,MAAM;AAAA,EAClD;AACJ;","names":["seatsio","seatsio"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/main/SeatsioEventManager.tsx","../src/main/Embeddable.tsx","../src/main/util.ts"],"sourcesContent":["import { EventManagerConfigOptions, Seatsio } from '@seatsio/seatsio-types'\nimport Embeddable from './Embeddable'\n\nexport default class SeatsioEventManager extends Embeddable<EventManagerConfigOptions> {\n createChart (seatsio: Seatsio, config: EventManagerConfigOptions) {\n return new seatsio.EventManager(config)\n }\n}","import * as React from 'react'\nimport {didPropsChange} from './util'\nimport { ChartDesigner, CommonConfigOptions, EventManager, Region, SeatingChart, Seatsio } from '@seatsio/seatsio-types'\n\nexport type EmbeddableProps<T > = {\n onRenderStarted?: (chart: SeatingChart | EventManager) => void\n chartJsUrl?: string\n region: Region\n} & T\n\nexport default abstract class Embeddable<T extends CommonConfigOptions> extends React.Component<EmbeddableProps<T>> {\n private container: React.RefObject<HTMLDivElement>\n private chart: SeatingChart\n private firstRender: boolean\n\n private static seatsioBundles: { [key: string]: Promise<Seatsio> } = {}\n\n static defaultProps = {\n chartJsUrl: 'https://cdn-{region}.seatsio.net/chart.js'\n }\n\n constructor(props: EmbeddableProps<T>) {\n super(props);\n this.container = React.createRef()\n this.firstRender = true\n }\n\n abstract createChart (seatsio: Seatsio, config: T): SeatingChart | EventManager | ChartDesigner\n\n componentDidMount () {\n if (!Embeddable.seatsioBundles[this.getChartUrl()] || this.firstRender) {\n this.createAndRenderChart()\n this.firstRender = false\n }\n }\n\n componentDidUpdate (prevProps: EmbeddableProps<T>) {\n if (didPropsChange(this.props, prevProps) && this.chart) {\n this.destroyChart()\n this.createAndRenderChart()\n }\n }\n\n getChartUrl () {\n return this.props.chartJsUrl.replace('{region}', this.props.region)\n }\n\n async createAndRenderChart () {\n const seatsio = await this.loadSeatsio()\n const config = this.extractConfigFromProps()\n config.container = this.container.current\n this.chart = this.createChart(seatsio, config).render()\n if (this.props.onRenderStarted) {\n this.props.onRenderStarted(this.chart)\n }\n }\n\n extractConfigFromProps (): any {\n let { chartJsUrl, divId, onRenderStarted, region, ...config } = this.props\n return config\n }\n\n componentWillUnmount () {\n this.destroyChart()\n }\n\n destroyChart () {\n if (this.chart && (this.chart as any).state !== 'DESTROYED') {\n this.chart.destroy()\n }\n }\n\n loadSeatsio (): Promise<Seatsio> {\n const chartUrl = this.getChartUrl()\n if (!Embeddable.seatsioBundles[chartUrl]) {\n Embeddable.seatsioBundles[chartUrl] = new Promise<Seatsio>((resolve, reject) => {\n const script = document.head.appendChild(document.createElement('script'))\n // Seatsio global is not replaced if already present, which would cause the wrong region bundle to resolve when changing region\n window.seatsio = undefined\n script.onload = () => {\n resolve(seatsio)\n }\n script.onerror = () => reject(`Could not load ${script.src}`)\n script.src = chartUrl\n })\n }\n\n return Embeddable.seatsioBundles[chartUrl]\n }\n\n render (): React.ReactNode {\n return (\n <div ref={this.container as unknown as React.RefObject<HTMLDivElement>} style={{'height': '100%', 'width': '100%'}} />\n )\n }\n}","import { BoothProps, GeneralAdmissionAreaProps, InteractiveObjectProps, InteractiveSectionProps, SeatProps, SelectableObjectProps, TableProps } from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObjectProps): obj is SeatProps => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObjectProps): obj is TableProps => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObjectProps): obj is InteractiveSectionProps => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObjectProps): obj is BoothProps => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObjectProps): obj is GeneralAdmissionAreaProps => obj.objectType === 'GeneralAdmissionArea'"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;;;ACEhB,IAAM,iBAAiB,CAAkC,WAAc,cAA0B;AACpG,MAAI,OAAO,KAAK,SAAS,EAAE,WAAW,OAAO,KAAK,SAAS,EAAE,QAAQ;AACjE,WAAO;AAAA,EACX;AACA,SAAO,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,aAAqB;AACrD,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,aAAa,WAAW;AACxB,UAAI,OAAO,cAAc,cAAc,OAAO,cAAc,YAAY;AACpE,eAAO,UAAU,SAAS,MAAM,UAAU,SAAS;AAAA,MACvD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A,EACJ;AAAA,EAEA,cAAiC;AAC7B,UAAM,WAAW,KAAK,YAAY;AAClC,QAAI,CAAC,YAAW,eAAe,QAAQ,GAAG;AACtC,kBAAW,eAAe,QAAQ,IAAI,IAAI,QAAiB,CAAC,SAAS,WAAW;AAC5E,cAAM,SAAS,SAAS,KAAK,YAAY,SAAS,cAAc,QAAQ,CAAC;AAEzE,eAAO,UAAU;AACjB,eAAO,SAAS,MAAM;AAClB,kBAAQ,OAAO;AAAA,QACnB;AACA,eAAO,UAAU,MAAM,OAAO,kBAAkB,OAAO,GAAG,EAAE;AAC5D,eAAO,MAAM;AAAA,MACjB,CAAC;AAAA,IACL;AAEA,WAAO,YAAW,eAAe,QAAQ;AAAA,EAC7C;AAAA,EAEA,SAA2B;AACvB,WACI,oCAAC,SAAI,KAAK,KAAK,WAAyD,OAAO,EAAC,UAAU,QAAQ,SAAS,OAAM,GAAG;AAAA,EAE5H;AACJ;AArF8B,YAKX,iBAAsD,CAAC;AAL5C,YAOnB,eAAe;AAAA,EAClB,YAAY;AAChB;AATJ,IAA8B,aAA9B;;;ADPA,IAAqB,sBAArB,cAAiD,WAAsC;AAAA,EACnF,YAAaC,UAAkB,QAAmC;AAC9D,WAAO,IAAIA,SAAQ,aAAa,MAAM;AAAA,EAC1C;AACJ;","names":["seatsio","seatsio"]}
1
+ {"version":3,"sources":["../src/main/SeatsioEventManager.tsx","../src/main/Embeddable.tsx","../src/main/util.ts"],"sourcesContent":["import { EventManagerConfigOptions, Seatsio } from '@seatsio/seatsio-types'\nimport Embeddable from './Embeddable'\n\nexport default class SeatsioEventManager extends Embeddable<EventManagerConfigOptions> {\n createChart (seatsio: Seatsio, config: EventManagerConfigOptions) {\n return new seatsio.EventManager(config)\n }\n}","import * as React from 'react'\nimport {didPropsChange} from './util'\nimport { ChartDesigner, CommonConfigOptions, EventManager, Region, SeatingChart, Seatsio } from '@seatsio/seatsio-types'\n\nexport type EmbeddableProps<T > = {\n onRenderStarted?: (chart: SeatingChart | EventManager) => void\n chartJsUrl?: string\n region: Region\n} & T\n\nexport default abstract class Embeddable<T extends CommonConfigOptions> extends React.Component<EmbeddableProps<T>> {\n private container: React.RefObject<HTMLDivElement>\n private chart: SeatingChart\n private firstRender: boolean\n\n private static seatsioBundles: { [key: string]: Promise<Seatsio> } = {}\n\n static defaultProps = {\n chartJsUrl: 'https://cdn-{region}.seatsio.net/chart.js'\n }\n\n constructor(props: EmbeddableProps<T>) {\n super(props);\n this.container = React.createRef()\n this.firstRender = true\n }\n\n abstract createChart (seatsio: Seatsio, config: T): SeatingChart | EventManager | ChartDesigner\n\n componentDidMount () {\n if (!Embeddable.seatsioBundles[this.getChartUrl()] || this.firstRender) {\n this.createAndRenderChart()\n this.firstRender = false\n }\n }\n\n componentDidUpdate (prevProps: EmbeddableProps<T>) {\n if (didPropsChange(this.props, prevProps) && this.chart) {\n this.destroyChart()\n this.createAndRenderChart()\n }\n }\n\n getChartUrl () {\n return this.props.chartJsUrl.replace('{region}', this.props.region)\n }\n\n async createAndRenderChart () {\n const seatsio = await this.loadSeatsio()\n const config = this.extractConfigFromProps()\n config.container = this.container.current\n this.chart = this.createChart(seatsio, config).render()\n if (this.props.onRenderStarted) {\n this.props.onRenderStarted(this.chart)\n }\n }\n\n extractConfigFromProps (): any {\n let { chartJsUrl, divId, onRenderStarted, region, ...config } = this.props\n return config\n }\n\n componentWillUnmount () {\n this.destroyChart()\n }\n\n destroyChart () {\n if (this.chart && (this.chart as any).state !== 'DESTROYED') {\n this.chart.destroy()\n }\n }\n\n loadSeatsio (): Promise<Seatsio> {\n const chartUrl = this.getChartUrl()\n if (!Embeddable.seatsioBundles[chartUrl]) {\n Embeddable.seatsioBundles[chartUrl] = new Promise<Seatsio>((resolve, reject) => {\n const script = document.head.appendChild(document.createElement('script'))\n // Seatsio global is not replaced if already present, which would cause the wrong region bundle to resolve when changing region\n window.seatsio = undefined\n script.onload = () => {\n resolve(seatsio)\n }\n script.onerror = () => reject(`Could not load ${script.src}`)\n script.src = chartUrl\n })\n }\n\n return Embeddable.seatsioBundles[chartUrl]\n }\n\n render (): React.ReactNode {\n return (\n <div ref={this.container as unknown as React.RefObject<HTMLDivElement>} style={{'height': '100%', 'width': '100%'}} />\n )\n }\n}","import {Booth, GeneralAdmissionArea, InteractiveSection, Seat, SelectableObject, Table} from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObject) => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObject): obj is Table => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObject): obj is InteractiveSection => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObject): obj is Booth => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObject): obj is GeneralAdmissionArea => obj.objectType === 'GeneralAdmissionArea'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;;;ACEhB,IAAM,iBAAiB,CAAkC,WAAc,cAA0B;AACpG,MAAI,OAAO,KAAK,SAAS,EAAE,WAAW,OAAO,KAAK,SAAS,EAAE,QAAQ;AACjE,WAAO;AAAA,EACX;AACA,SAAO,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,aAAqB;AACrD,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,aAAa,WAAW;AACxB,UAAI,OAAO,cAAc,cAAc,OAAO,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KAAK,MAAc,UAAU,aAAa;AACzD,WAAK,MAAM,QAAQ;AAAA,IACvB;AAAA,EACJ;AAAA,EAEA,cAAiC;AAC7B,UAAM,WAAW,KAAK,YAAY;AAClC,QAAI,CAAC,YAAW,eAAe,QAAQ,GAAG;AACtC,kBAAW,eAAe,QAAQ,IAAI,IAAI,QAAiB,CAAC,SAAS,WAAW;AAC5E,cAAM,SAAS,SAAS,KAAK,YAAY,SAAS,cAAc,QAAQ,CAAC;AAEzE,eAAO,UAAU;AACjB,eAAO,SAAS,MAAM;AAClB,kBAAQ,OAAO;AAAA,QACnB;AACA,eAAO,UAAU,MAAM,OAAO,kBAAkB,OAAO,GAAG,EAAE;AAC5D,eAAO,MAAM;AAAA,MACjB,CAAC;AAAA,IACL;AAEA,WAAO,YAAW,eAAe,QAAQ;AAAA,EAC7C;AAAA,EAEA,SAA2B;AACvB,WACI,oCAAC,SAAI,KAAK,KAAK,WAAyD,OAAO,EAAC,UAAU,QAAQ,SAAS,OAAM,GAAG;AAAA,EAE5H;AACJ;AArF8B,YAKX,iBAAsD,CAAC;AAL5C,YAOnB,eAAe;AAAA,EAClB,YAAY;AAChB;AATJ,IAA8B,aAA9B;;;ADPA,IAAqB,sBAArB,cAAiD,WAAsC;AAAA,EACnF,YAAaC,UAAkB,QAAmC;AAC9D,WAAO,IAAIA,SAAQ,aAAa,MAAM;AAAA,EAC1C;AACJ;","names":["seatsio","seatsio"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/main/Embeddable.tsx","../src/main/util.ts","../src/main/SeatsioEventManager.tsx"],"sourcesContent":["import * as React from 'react'\nimport {didPropsChange} from './util'\nimport { ChartDesigner, CommonConfigOptions, EventManager, Region, SeatingChart, Seatsio } from '@seatsio/seatsio-types'\n\nexport type EmbeddableProps<T > = {\n onRenderStarted?: (chart: SeatingChart | EventManager) => void\n chartJsUrl?: string\n region: Region\n} & T\n\nexport default abstract class Embeddable<T extends CommonConfigOptions> extends React.Component<EmbeddableProps<T>> {\n private container: React.RefObject<HTMLDivElement>\n private chart: SeatingChart\n private firstRender: boolean\n\n private static seatsioBundles: { [key: string]: Promise<Seatsio> } = {}\n\n static defaultProps = {\n chartJsUrl: 'https://cdn-{region}.seatsio.net/chart.js'\n }\n\n constructor(props: EmbeddableProps<T>) {\n super(props);\n this.container = React.createRef()\n this.firstRender = true\n }\n\n abstract createChart (seatsio: Seatsio, config: T): SeatingChart | EventManager | ChartDesigner\n\n componentDidMount () {\n if (!Embeddable.seatsioBundles[this.getChartUrl()] || this.firstRender) {\n this.createAndRenderChart()\n this.firstRender = false\n }\n }\n\n componentDidUpdate (prevProps: EmbeddableProps<T>) {\n if (didPropsChange(this.props, prevProps) && this.chart) {\n this.destroyChart()\n this.createAndRenderChart()\n }\n }\n\n getChartUrl () {\n return this.props.chartJsUrl.replace('{region}', this.props.region)\n }\n\n async createAndRenderChart () {\n const seatsio = await this.loadSeatsio()\n const config = this.extractConfigFromProps()\n config.container = this.container.current\n this.chart = this.createChart(seatsio, config).render()\n if (this.props.onRenderStarted) {\n this.props.onRenderStarted(this.chart)\n }\n }\n\n extractConfigFromProps (): any {\n let { chartJsUrl, divId, onRenderStarted, region, ...config } = this.props\n return config\n }\n\n componentWillUnmount () {\n this.destroyChart()\n }\n\n destroyChart () {\n if (this.chart && (this.chart as any).state !== 'DESTROYED') {\n this.chart.destroy()\n }\n }\n\n loadSeatsio (): Promise<Seatsio> {\n const chartUrl = this.getChartUrl()\n if (!Embeddable.seatsioBundles[chartUrl]) {\n Embeddable.seatsioBundles[chartUrl] = new Promise<Seatsio>((resolve, reject) => {\n const script = document.head.appendChild(document.createElement('script'))\n // Seatsio global is not replaced if already present, which would cause the wrong region bundle to resolve when changing region\n window.seatsio = undefined\n script.onload = () => {\n resolve(seatsio)\n }\n script.onerror = () => reject(`Could not load ${script.src}`)\n script.src = chartUrl\n })\n }\n\n return Embeddable.seatsioBundles[chartUrl]\n }\n\n render (): React.ReactNode {\n return (\n <div ref={this.container as unknown as React.RefObject<HTMLDivElement>} style={{'height': '100%', 'width': '100%'}} />\n )\n }\n}","import { BoothProps, GeneralAdmissionAreaProps, InteractiveObjectProps, InteractiveSectionProps, SeatProps, SelectableObjectProps, TableProps } from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObjectProps): obj is SeatProps => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObjectProps): obj is TableProps => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObjectProps): obj is InteractiveSectionProps => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObjectProps): obj is BoothProps => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObjectProps): obj is GeneralAdmissionAreaProps => obj.objectType === 'GeneralAdmissionArea'","import { EventManagerConfigOptions, Seatsio } from '@seatsio/seatsio-types'\nimport Embeddable from './Embeddable'\n\nexport default class SeatsioEventManager extends Embeddable<EventManagerConfigOptions> {\n createChart (seatsio: Seatsio, config: EventManagerConfigOptions) {\n return new seatsio.EventManager(config)\n }\n}"],"mappings":";AAAA,YAAY,WAAW;;;ACEhB,IAAM,iBAAiB,CAAkC,WAAc,cAA0B;AACpG,MAAI,OAAO,KAAK,SAAS,EAAE,WAAW,OAAO,KAAK,SAAS,EAAE,QAAQ;AACjE,WAAO;AAAA,EACX;AACA,SAAO,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,aAAqB;AACrD,QAAI,YAAY,UAAU,QAAQ;AAClC,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EA,uBAAwB;AACpB,SAAK,aAAa;AAAA,EACtB;AAAA,EAEA,eAAgB;AACZ,QAAI,KAAK,SAAU,KAAK,MAAc,UAAU,aAAa;AACzD,WAAK,MAAM,QAAQ;AAAA,IACvB;AAAA,EACJ;AAAA,EAEA,cAAiC;AAC7B,UAAM,WAAW,KAAK,YAAY;AAClC,QAAI,CAAC,YAAW,eAAe,QAAQ,GAAG;AACtC,kBAAW,eAAe,QAAQ,IAAI,IAAI,QAAiB,CAAC,SAAS,WAAW;AAC5E,cAAM,SAAS,SAAS,KAAK,YAAY,SAAS,cAAc,QAAQ,CAAC;AAEzE,eAAO,UAAU;AACjB,eAAO,SAAS,MAAM;AAClB,kBAAQ,OAAO;AAAA,QACnB;AACA,eAAO,UAAU,MAAM,OAAO,kBAAkB,OAAO,GAAG,EAAE;AAC5D,eAAO,MAAM;AAAA,MACjB,CAAC;AAAA,IACL;AAEA,WAAO,YAAW,eAAe,QAAQ;AAAA,EAC7C;AAAA,EAEA,SAA2B;AACvB,WACI,oCAAC,SAAI,KAAK,KAAK,WAAyD,OAAO,EAAC,UAAU,QAAQ,SAAS,OAAM,GAAG;AAAA,EAE5H;AACJ;AArF8B,YAKX,iBAAsD,CAAC;AAL5C,YAOnB,eAAe;AAAA,EAClB,YAAY;AAChB;AATJ,IAA8B,aAA9B;;;AEPA,IAAqB,sBAArB,cAAiD,WAAsC;AAAA,EACnF,YAAaC,UAAkB,QAAmC;AAC9D,WAAO,IAAIA,SAAQ,aAAa,MAAM;AAAA,EAC1C;AACJ;","names":["seatsio","seatsio"]}
1
+ {"version":3,"sources":["../src/main/Embeddable.tsx","../src/main/util.ts","../src/main/SeatsioEventManager.tsx"],"sourcesContent":["import * as React from 'react'\nimport {didPropsChange} from './util'\nimport { ChartDesigner, CommonConfigOptions, EventManager, Region, SeatingChart, Seatsio } from '@seatsio/seatsio-types'\n\nexport type EmbeddableProps<T > = {\n onRenderStarted?: (chart: SeatingChart | EventManager) => void\n chartJsUrl?: string\n region: Region\n} & T\n\nexport default abstract class Embeddable<T extends CommonConfigOptions> extends React.Component<EmbeddableProps<T>> {\n private container: React.RefObject<HTMLDivElement>\n private chart: SeatingChart\n private firstRender: boolean\n\n private static seatsioBundles: { [key: string]: Promise<Seatsio> } = {}\n\n static defaultProps = {\n chartJsUrl: 'https://cdn-{region}.seatsio.net/chart.js'\n }\n\n constructor(props: EmbeddableProps<T>) {\n super(props);\n this.container = React.createRef()\n this.firstRender = true\n }\n\n abstract createChart (seatsio: Seatsio, config: T): SeatingChart | EventManager | ChartDesigner\n\n componentDidMount () {\n if (!Embeddable.seatsioBundles[this.getChartUrl()] || this.firstRender) {\n this.createAndRenderChart()\n this.firstRender = false\n }\n }\n\n componentDidUpdate (prevProps: EmbeddableProps<T>) {\n if (didPropsChange(this.props, prevProps) && this.chart) {\n this.destroyChart()\n this.createAndRenderChart()\n }\n }\n\n getChartUrl () {\n return this.props.chartJsUrl.replace('{region}', this.props.region)\n }\n\n async createAndRenderChart () {\n const seatsio = await this.loadSeatsio()\n const config = this.extractConfigFromProps()\n config.container = this.container.current\n this.chart = this.createChart(seatsio, config).render()\n if (this.props.onRenderStarted) {\n this.props.onRenderStarted(this.chart)\n }\n }\n\n extractConfigFromProps (): any {\n let { chartJsUrl, divId, onRenderStarted, region, ...config } = this.props\n return config\n }\n\n componentWillUnmount () {\n this.destroyChart()\n }\n\n destroyChart () {\n if (this.chart && (this.chart as any).state !== 'DESTROYED') {\n this.chart.destroy()\n }\n }\n\n loadSeatsio (): Promise<Seatsio> {\n const chartUrl = this.getChartUrl()\n if (!Embeddable.seatsioBundles[chartUrl]) {\n Embeddable.seatsioBundles[chartUrl] = new Promise<Seatsio>((resolve, reject) => {\n const script = document.head.appendChild(document.createElement('script'))\n // Seatsio global is not replaced if already present, which would cause the wrong region bundle to resolve when changing region\n window.seatsio = undefined\n script.onload = () => {\n resolve(seatsio)\n }\n script.onerror = () => reject(`Could not load ${script.src}`)\n script.src = chartUrl\n })\n }\n\n return Embeddable.seatsioBundles[chartUrl]\n }\n\n render (): React.ReactNode {\n return (\n <div ref={this.container as unknown as React.RefObject<HTMLDivElement>} style={{'height': '100%', 'width': '100%'}} />\n )\n }\n}","import {Booth, GeneralAdmissionArea, InteractiveSection, Seat, SelectableObject, Table} from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObject) => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObject): obj is Table => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObject): obj is InteractiveSection => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObject): obj is Booth => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObject): obj is GeneralAdmissionArea => obj.objectType === 'GeneralAdmissionArea'\n","import { EventManagerConfigOptions, Seatsio } from '@seatsio/seatsio-types'\nimport Embeddable from './Embeddable'\n\nexport default class SeatsioEventManager extends Embeddable<EventManagerConfigOptions> {\n createChart (seatsio: Seatsio, config: EventManagerConfigOptions) {\n return new seatsio.EventManager(config)\n }\n}"],"mappings":";AAAA,YAAY,WAAW;;;ACEhB,IAAM,iBAAiB,CAAkC,WAAc,cAA0B;AACpG,MAAI,OAAO,KAAK,SAAS,EAAE,WAAW,OAAO,KAAK,SAAS,EAAE,QAAQ;AACjE,WAAO;AAAA,EACX;AACA,SAAO,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,aAAqB;AACrD,QAAI,YAAY,UAAU,QAAQ;AA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,EAEA,uBAAwB;AACpB,SAAK,aAAa;AAAA,EACtB;AAAA,EAEA,eAAgB;AACZ,QAAI,KAAK,SAAU,KAAK,MAAc,UAAU,aAAa;AACzD,WAAK,MAAM,QAAQ;AAAA,IACvB;AAAA,EACJ;AAAA,EAEA,cAAiC;AAC7B,UAAM,WAAW,KAAK,YAAY;AAClC,QAAI,CAAC,YAAW,eAAe,QAAQ,GAAG;AACtC,kBAAW,eAAe,QAAQ,IAAI,IAAI,QAAiB,CAAC,SAAS,WAAW;AAC5E,cAAM,SAAS,SAAS,KAAK,YAAY,SAAS,cAAc,QAAQ,CAAC;AAEzE,eAAO,UAAU;AACjB,eAAO,SAAS,MAAM;AAClB,kBAAQ,OAAO;AAAA,QACnB;AACA,eAAO,UAAU,MAAM,OAAO,kBAAkB,OAAO,GAAG,EAAE;AAC5D,eAAO,MAAM;AAAA,MACjB,CAAC;AAAA,IACL;AAEA,WAAO,YAAW,eAAe,QAAQ;AAAA,EAC7C;AAAA,EAEA,SAA2B;AACvB,WACI,oCAAC,SAAI,KAAK,KAAK,WAAyD,OAAO,EAAC,UAAU,QAAQ,SAAS,OAAM,GAAG;AAAA,EAE5H;AACJ;AArF8B,YAKX,iBAAsD,CAAC;AAL5C,YAOnB,eAAe;AAAA,EAClB,YAAY;AAChB;AATJ,IAA8B,aAA9B;;;AEPA,IAAqB,sBAArB,cAAiD,WAAsC;AAAA,EACnF,YAAaC,UAAkB,QAAmC;AAC9D,WAAO,IAAIA,SAAQ,aAAa,MAAM;AAAA,EAC1C;AACJ;","names":["seatsio","seatsio"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/main/SeatsioSeatingChart.tsx","../src/main/Embeddable.tsx","../src/main/util.ts"],"sourcesContent":["import { ChartRendererConfigOptions, Seatsio } from '@seatsio/seatsio-types'\nimport Embeddable from './Embeddable'\n\nexport default class SeatsioSeatingChart extends Embeddable<ChartRendererConfigOptions> {\n createChart (seatsio: Seatsio, config: ChartRendererConfigOptions) {\n return new seatsio.SeatingChart(config)\n }\n}","import * as React from 'react'\nimport {didPropsChange} from './util'\nimport { ChartDesigner, CommonConfigOptions, EventManager, Region, SeatingChart, Seatsio } from '@seatsio/seatsio-types'\n\nexport type EmbeddableProps<T > = {\n onRenderStarted?: (chart: SeatingChart | EventManager) => void\n chartJsUrl?: string\n region: Region\n} & T\n\nexport default abstract class Embeddable<T extends CommonConfigOptions> extends React.Component<EmbeddableProps<T>> {\n private container: React.RefObject<HTMLDivElement>\n private chart: SeatingChart\n private firstRender: boolean\n\n private static seatsioBundles: { [key: string]: Promise<Seatsio> } = {}\n\n static defaultProps = {\n chartJsUrl: 'https://cdn-{region}.seatsio.net/chart.js'\n }\n\n constructor(props: EmbeddableProps<T>) {\n super(props);\n this.container = React.createRef()\n this.firstRender = true\n }\n\n abstract createChart (seatsio: Seatsio, config: T): SeatingChart | EventManager | ChartDesigner\n\n componentDidMount () {\n if (!Embeddable.seatsioBundles[this.getChartUrl()] || this.firstRender) {\n this.createAndRenderChart()\n this.firstRender = false\n }\n }\n\n componentDidUpdate (prevProps: EmbeddableProps<T>) {\n if (didPropsChange(this.props, prevProps) && this.chart) {\n this.destroyChart()\n this.createAndRenderChart()\n }\n }\n\n getChartUrl () {\n return this.props.chartJsUrl.replace('{region}', this.props.region)\n }\n\n async createAndRenderChart () {\n const seatsio = await this.loadSeatsio()\n const config = this.extractConfigFromProps()\n config.container = this.container.current\n this.chart = this.createChart(seatsio, config).render()\n if (this.props.onRenderStarted) {\n this.props.onRenderStarted(this.chart)\n }\n }\n\n extractConfigFromProps (): any {\n let { chartJsUrl, divId, onRenderStarted, region, ...config } = this.props\n return config\n }\n\n componentWillUnmount () {\n this.destroyChart()\n }\n\n destroyChart () {\n if (this.chart && (this.chart as any).state !== 'DESTROYED') {\n this.chart.destroy()\n }\n }\n\n loadSeatsio (): Promise<Seatsio> {\n const chartUrl = this.getChartUrl()\n if (!Embeddable.seatsioBundles[chartUrl]) {\n Embeddable.seatsioBundles[chartUrl] = new Promise<Seatsio>((resolve, reject) => {\n const script = document.head.appendChild(document.createElement('script'))\n // Seatsio global is not replaced if already present, which would cause the wrong region bundle to resolve when changing region\n window.seatsio = undefined\n script.onload = () => {\n resolve(seatsio)\n }\n script.onerror = () => reject(`Could not load ${script.src}`)\n script.src = chartUrl\n })\n }\n\n return Embeddable.seatsioBundles[chartUrl]\n }\n\n render (): React.ReactNode {\n return (\n <div ref={this.container as unknown as React.RefObject<HTMLDivElement>} style={{'height': '100%', 'width': '100%'}} />\n )\n }\n}","import { BoothProps, GeneralAdmissionAreaProps, InteractiveObjectProps, InteractiveSectionProps, SeatProps, SelectableObjectProps, TableProps } from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObjectProps): obj is SeatProps => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObjectProps): obj is TableProps => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObjectProps): obj is InteractiveSectionProps => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObjectProps): obj is BoothProps => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObjectProps): obj is GeneralAdmissionAreaProps => obj.objectType === 'GeneralAdmissionArea'"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;;;ACEhB,IAAM,iBAAiB,CAAkC,WAAc,cAA0B;AACpG,MAAI,OAAO,KAAK,SA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B,KAAK,KAAK;AAAA,IACzC;AAAA,EACJ;AAAA,EAEA,yBAA+B;AAC3B,QAAI,EAAE,YAAY,OAAO,iBAAiB,QAAQ,GAAG,OAAO,IAAI,KAAK;AACrE,WAAO;AAAA,EACX;AAAA,EAEA,uBAAwB;AACpB,SAAK,aAAa;AAAA,EACtB;AAAA,EAEA,eAAgB;AACZ,QAAI,KAAK,SAAU,KAAK,MAAc,UAAU,aAAa;AACzD,WAAK,MAAM,QAAQ;AAAA,IACvB;AAAA,EACJ;AAAA,EAEA,cAAiC;AAC7B,UAAM,WAAW,KAAK,YAAY;AAClC,QAAI,CAAC,YAAW,eAAe,QAAQ,GAAG;AACtC,kBAAW,eAAe,QAAQ,IAAI,IAAI,QAAiB,CAAC,SAAS,WAAW;AAC5E,cAAM,SAAS,SAAS,KAAK,YAAY,SAAS,cAAc,QAAQ,CAAC;AAEzE,eAAO,UAAU;AACjB,eAAO,SAAS,MAAM;AAClB,kBAAQ,OAAO;AAAA,QACnB;AACA,eAAO,UAAU,MAAM,OAAO,kBAAkB,OAAO,GAAG,EAAE;AAC5D,eAAO,MAAM;AAAA,MACjB,CAAC;AAAA,IACL;AAEA,WAAO,YAAW,eAAe,QAAQ;AAAA,EAC7C;AAAA,EAEA,SAA2B;AACvB,WACI,oCAAC,SAAI,KAAK,KAAK,WAAyD,OAAO,EAAC,UAAU,QAAQ,SAAS,OAAM,GAAG;AAAA,EAE5H;AACJ;AArF8B,YAKX,iBAAsD,CAAC;AAL5C,YAOnB,eAAe;AAAA,EAClB,YAAY;AAChB;AATJ,IAA8B,aAA9B;;;ADPA,IAAqB,sBAArB,cAAiD,WAAuC;AAAA,EACpF,YAAaC,UAAkB,QAAoC;AAC/D,WAAO,IAAIA,SAAQ,aAAa,MAAM;AAAA,EAC1C;AACJ;","names":["seatsio","seatsio"]}
1
+ {"version":3,"sources":["../src/main/SeatsioSeatingChart.tsx","../src/main/Embeddable.tsx","../src/main/util.ts"],"sourcesContent":["import { ChartRendererConfigOptions, Seatsio } from '@seatsio/seatsio-types'\nimport Embeddable from './Embeddable'\n\nexport default class SeatsioSeatingChart extends Embeddable<ChartRendererConfigOptions> {\n createChart (seatsio: Seatsio, config: ChartRendererConfigOptions) {\n return new seatsio.SeatingChart(config)\n }\n}","import * as React from 'react'\nimport {didPropsChange} from './util'\nimport { ChartDesigner, CommonConfigOptions, EventManager, Region, SeatingChart, Seatsio } from '@seatsio/seatsio-types'\n\nexport type EmbeddableProps<T > = {\n onRenderStarted?: (chart: SeatingChart | EventManager) => void\n chartJsUrl?: string\n region: Region\n} & T\n\nexport default abstract class Embeddable<T extends CommonConfigOptions> extends React.Component<EmbeddableProps<T>> {\n private container: React.RefObject<HTMLDivElement>\n private chart: SeatingChart\n private firstRender: boolean\n\n private static seatsioBundles: { [key: string]: Promise<Seatsio> } = {}\n\n static defaultProps = {\n chartJsUrl: 'https://cdn-{region}.seatsio.net/chart.js'\n }\n\n constructor(props: EmbeddableProps<T>) {\n super(props);\n this.container = React.createRef()\n this.firstRender = true\n }\n\n abstract createChart (seatsio: Seatsio, config: T): SeatingChart | EventManager | ChartDesigner\n\n componentDidMount () {\n if (!Embeddable.seatsioBundles[this.getChartUrl()] || this.firstRender) {\n this.createAndRenderChart()\n this.firstRender = false\n }\n }\n\n componentDidUpdate (prevProps: EmbeddableProps<T>) {\n if (didPropsChange(this.props, prevProps) && this.chart) {\n this.destroyChart()\n this.createAndRenderChart()\n }\n }\n\n getChartUrl () {\n return this.props.chartJsUrl.replace('{region}', this.props.region)\n }\n\n async createAndRenderChart () {\n const seatsio = await this.loadSeatsio()\n const config = this.extractConfigFromProps()\n config.container = this.container.current\n this.chart = this.createChart(seatsio, config).render()\n if (this.props.onRenderStarted) {\n this.props.onRenderStarted(this.chart)\n }\n }\n\n extractConfigFromProps (): any {\n let { chartJsUrl, divId, onRenderStarted, region, ...config } = this.props\n return config\n }\n\n componentWillUnmount () {\n this.destroyChart()\n }\n\n destroyChart () {\n if (this.chart && (this.chart as any).state !== 'DESTROYED') {\n this.chart.destroy()\n }\n }\n\n loadSeatsio (): Promise<Seatsio> {\n const chartUrl = this.getChartUrl()\n if (!Embeddable.seatsioBundles[chartUrl]) {\n Embeddable.seatsioBundles[chartUrl] = new Promise<Seatsio>((resolve, reject) => {\n const script = document.head.appendChild(document.createElement('script'))\n // Seatsio global is not replaced if already present, which would cause the wrong region bundle to resolve when changing region\n window.seatsio = undefined\n script.onload = () => {\n resolve(seatsio)\n }\n script.onerror = () => reject(`Could not load ${script.src}`)\n script.src = chartUrl\n })\n }\n\n return Embeddable.seatsioBundles[chartUrl]\n }\n\n render (): React.ReactNode {\n return (\n <div ref={this.container as unknown as React.RefObject<HTMLDivElement>} style={{'height': '100%', 'width': '100%'}} />\n )\n }\n}","import {Booth, GeneralAdmissionArea, InteractiveSection, Seat, SelectableObject, Table} from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObject) => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObject): obj is Table => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObject): obj is InteractiveSection => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObject): obj is Booth => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObject): obj is GeneralAdmissionArea => obj.objectType === 'GeneralAdmissionArea'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YA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,"sources":["../src/main/Embeddable.tsx","../src/main/util.ts","../src/main/SeatsioSeatingChart.tsx"],"sourcesContent":["import * as React from 'react'\nimport {didPropsChange} from './util'\nimport { ChartDesigner, CommonConfigOptions, EventManager, Region, SeatingChart, Seatsio } from '@seatsio/seatsio-types'\n\nexport type EmbeddableProps<T > = {\n onRenderStarted?: (chart: SeatingChart | EventManager) => void\n chartJsUrl?: string\n region: Region\n} & T\n\nexport default abstract class Embeddable<T extends CommonConfigOptions> extends React.Component<EmbeddableProps<T>> {\n private container: React.RefObject<HTMLDivElement>\n private chart: SeatingChart\n private firstRender: boolean\n\n private static seatsioBundles: { [key: string]: Promise<Seatsio> } = {}\n\n static defaultProps = {\n chartJsUrl: 'https://cdn-{region}.seatsio.net/chart.js'\n }\n\n constructor(props: EmbeddableProps<T>) {\n super(props);\n this.container = React.createRef()\n this.firstRender = true\n }\n\n abstract createChart (seatsio: Seatsio, config: T): SeatingChart | EventManager | ChartDesigner\n\n componentDidMount () {\n if (!Embeddable.seatsioBundles[this.getChartUrl()] || this.firstRender) {\n this.createAndRenderChart()\n this.firstRender = false\n }\n }\n\n componentDidUpdate (prevProps: EmbeddableProps<T>) {\n if (didPropsChange(this.props, prevProps) && this.chart) {\n this.destroyChart()\n this.createAndRenderChart()\n }\n }\n\n getChartUrl () {\n return this.props.chartJsUrl.replace('{region}', this.props.region)\n }\n\n async createAndRenderChart () {\n const seatsio = await this.loadSeatsio()\n const config = this.extractConfigFromProps()\n config.container = this.container.current\n this.chart = this.createChart(seatsio, config).render()\n if (this.props.onRenderStarted) {\n this.props.onRenderStarted(this.chart)\n }\n }\n\n extractConfigFromProps (): any {\n let { chartJsUrl, divId, onRenderStarted, region, ...config } = this.props\n return config\n }\n\n componentWillUnmount () {\n this.destroyChart()\n }\n\n destroyChart () {\n if (this.chart && (this.chart as any).state !== 'DESTROYED') {\n this.chart.destroy()\n }\n }\n\n loadSeatsio (): Promise<Seatsio> {\n const chartUrl = this.getChartUrl()\n if (!Embeddable.seatsioBundles[chartUrl]) {\n Embeddable.seatsioBundles[chartUrl] = new Promise<Seatsio>((resolve, reject) => {\n const script = document.head.appendChild(document.createElement('script'))\n // Seatsio global is not replaced if already present, which would cause the wrong region bundle to resolve when changing region\n window.seatsio = undefined\n script.onload = () => {\n resolve(seatsio)\n }\n script.onerror = () => reject(`Could not load ${script.src}`)\n script.src = chartUrl\n })\n }\n\n return Embeddable.seatsioBundles[chartUrl]\n }\n\n render (): React.ReactNode {\n return (\n <div ref={this.container as unknown as React.RefObject<HTMLDivElement>} style={{'height': '100%', 'width': '100%'}} />\n )\n }\n}","import { BoothProps, GeneralAdmissionAreaProps, InteractiveObjectProps, InteractiveSectionProps, SeatProps, SelectableObjectProps, TableProps } from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObjectProps): obj is SeatProps => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObjectProps): obj is TableProps => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObjectProps): obj is InteractiveSectionProps => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObjectProps): obj is BoothProps => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObjectProps): obj is GeneralAdmissionAreaProps => obj.objectType === 'GeneralAdmissionArea'","import { ChartRendererConfigOptions, Seatsio } from '@seatsio/seatsio-types'\nimport Embeddable from './Embeddable'\n\nexport default class SeatsioSeatingChart extends Embeddable<ChartRendererConfigO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WAAO,IAAIA,SAAQ,aAAa,MAAM;AAAA,EAC1C;AACJ;","names":["seatsio","seatsio"]}
1
+ {"version":3,"sources":["../src/main/Embeddable.tsx","../src/main/util.ts","../src/main/SeatsioSeatingChart.tsx"],"sourcesContent":["import * as React from 'react'\nimport {didPropsChange} from './util'\nimport { ChartDesigner, CommonConfigOptions, EventManager, Region, SeatingChart, Seatsio } from '@seatsio/seatsio-types'\n\nexport type EmbeddableProps<T > = {\n onRenderStarted?: (chart: SeatingChart | EventManager) => void\n chartJsUrl?: string\n region: Region\n} & T\n\nexport default abstract class Embeddable<T extends CommonConfigOptions> extends React.Component<EmbeddableProps<T>> {\n private container: React.RefObject<HTMLDivElement>\n private chart: SeatingChart\n private firstRender: boolean\n\n private static seatsioBundles: { [key: string]: Promise<Seatsio> } = {}\n\n static defaultProps = {\n chartJsUrl: 'https://cdn-{region}.seatsio.net/chart.js'\n }\n\n constructor(props: EmbeddableProps<T>) {\n super(props);\n this.container = React.createRef()\n this.firstRender = true\n }\n\n abstract createChart (seatsio: Seatsio, config: T): SeatingChart | EventManager | ChartDesigner\n\n componentDidMount () {\n if (!Embeddable.seatsioBundles[this.getChartUrl()] || this.firstRender) {\n this.createAndRenderChart()\n this.firstRender = false\n }\n }\n\n componentDidUpdate (prevProps: EmbeddableProps<T>) {\n if (didPropsChange(this.props, prevProps) && this.chart) {\n this.destroyChart()\n this.createAndRenderChart()\n }\n }\n\n getChartUrl () {\n return this.props.chartJsUrl.replace('{region}', this.props.region)\n }\n\n async createAndRenderChart () {\n const seatsio = await this.loadSeatsio()\n const config = this.extractConfigFromProps()\n config.container = this.container.current\n this.chart = this.createChart(seatsio, config).render()\n if (this.props.onRenderStarted) {\n this.props.onRenderStarted(this.chart)\n }\n }\n\n extractConfigFromProps (): any {\n let { chartJsUrl, divId, onRenderStarted, region, ...config } = this.props\n return config\n }\n\n componentWillUnmount () {\n this.destroyChart()\n }\n\n destroyChart () {\n if (this.chart && (this.chart as any).state !== 'DESTROYED') {\n this.chart.destroy()\n }\n }\n\n loadSeatsio (): Promise<Seatsio> {\n const chartUrl = this.getChartUrl()\n if (!Embeddable.seatsioBundles[chartUrl]) {\n Embeddable.seatsioBundles[chartUrl] = new Promise<Seatsio>((resolve, reject) => {\n const script = document.head.appendChild(document.createElement('script'))\n // Seatsio global is not replaced if already present, which would cause the wrong region bundle to resolve when changing region\n window.seatsio = undefined\n script.onload = () => {\n resolve(seatsio)\n }\n script.onerror = () => reject(`Could not load ${script.src}`)\n script.src = chartUrl\n })\n }\n\n return Embeddable.seatsioBundles[chartUrl]\n }\n\n render (): React.ReactNode {\n return (\n <div ref={this.container as unknown as React.RefObject<HTMLDivElement>} style={{'height': '100%', 'width': '100%'}} />\n )\n }\n}","import {Booth, GeneralAdmissionArea, InteractiveSection, Seat, SelectableObject, Table} from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObject) => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObject): obj is Table => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObject): obj is InteractiveSection => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObject): obj is Booth => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObject): obj is GeneralAdmissionArea => obj.objectType === 'GeneralAdmissionArea'\n","import { ChartRendererConfigOptions, Seatsio } from '@seatsio/seatsio-types'\nimport Embeddable from './Embeddable'\n\nexport default class SeatsioSeatingChart extends Embeddable<ChartRendererConfigOptions> {\n createChart (seatsio: Seatsio, config: ChartRendererConfigOptions) {\n return new seatsio.SeatingChart(config)\n }\n}"],"mappings":";AAAA,YAAY,WAAW;;;ACEhB,IAAM,iBAAiB,CAAkC,WAAc,cAA0B;AACpG,MAAI,OAAO,KAAK,SAAS,EAAE,WAAW,OAAO,KAAK,SAAS,EAAE,QAAQ;AACjE,WAAO;AAAA,EACX;AACA,SAAO,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,aAAqB;AACrD,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,aAAa,WAAW;AACxB,UAAI,OAAO,cAAc,cAAc,OAAO,cAAc,YAAY;AACpE,eAAO,UAAU,SAAS,MAAM,UAAU,SAAS;AAAA,MACvD;AACA,UAAI,OAAO,cAAc,YAAY,OAAO,cAAc,UAAU;AAChE,eAAO,eAAe,WAAW,SAAS;AAAA,MAC9C;AAAA,IACJ;AACA,WAAO,cAAc;AAAA,EACzB,CAAC;AACL;;;ADTA,IAA8B,cAA9B,MAA8B,oBAAwD,gBAA8B;AAAA,EAWhH,YAAY,OAA2B;AACnC,UAAM,KAAK;AACX,SAAK,YAAkB,gBAAU;AACjC,SAAK,cAAc;AAAA,EACvB;AAAA,EAIA,oBAAqB;AACjB,QAAI,CAAC,YAAW,eAAe,KAAK,YAAY,CAAC,KAAK,KAAK,aAAa;AACpE,WAAK,qBAAqB;AAC1B,WAAK,cAAc;AAAA,IACvB;AAAA,EACJ;AAAA,EAEA,mBAAoB,WAA+B;AAC/C,QAAI,eAAe,KAAK,OAAO,SAAS,KAAK,KAAK,OAAO;AACrD,WAAK,aAAa;AAClB,WAAK,qBAAqB;AAAA,IAC9B;AAAA,EACJ;AAAA,EAEA,cAAe;AACX,WAAO,KAAK,MAAM,WAAW,QAAQ,YAAY,KAAK,MAAM,MAAM;AAAA,EACtE;AAAA,EAEA,MAAM,uBAAwB;AAC1B,UAAMA,WAAU,MAAM,KAA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QAAoC;AAC/D,WAAO,IAAIA,SAAQ,aAAa,MAAM;AAAA,EAC1C;AACJ;","names":["seatsio","seatsio"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/main/index.ts","../src/main/Embeddable.tsx","../src/main/util.ts","../src/main/SeatsioDesigner.tsx","../src/main/SeatsioEventManager.tsx","../src/main/SeatsioSeatingChart.tsx"],"sourcesContent":["export { default as SeatsioDesigner } from './SeatsioDesigner'\nexport { default as SeatsioEventManager } from './SeatsioEventManager'\nexport { default as SeatsioSeatingChart } from './SeatsioSeatingChart'\nexport { isBooth, isGeneralAdmission, isSeat, isSection, isTable } from './util'\nexport type * from '@seatsio/seatsio-types';\n","import * as React from 'react'\nimport {didPropsChange} from './util'\nimport { ChartDesigner, CommonConfigOptions, EventManager, Region, SeatingChart, Seatsio } from '@seatsio/seatsio-types'\n\nexport type EmbeddableProps<T > = {\n onRenderStarted?: (chart: SeatingChart | EventManager) => void\n chartJsUrl?: string\n region: Region\n} & T\n\nexport default abstract class Embeddable<T extends CommonConfigOptions> extends React.Component<EmbeddableProps<T>> {\n private container: React.RefObject<HTMLDivElement>\n private chart: SeatingChart\n private firstRender: boolean\n\n private static seatsioBundles: { [key: string]: Promise<Seatsio> } = {}\n\n static defaultProps = {\n chartJsUrl: 'https://cdn-{region}.seatsio.net/chart.js'\n }\n\n constructor(props: EmbeddableProps<T>) {\n super(props);\n this.container = React.createRef()\n this.firstRender = true\n }\n\n abstract createChart (seatsio: Seatsio, config: T): SeatingChart | EventManager | ChartDesigner\n\n componentDidMount () {\n if (!Embeddable.seatsioBundles[this.getChartUrl()] || this.firstRender) {\n this.createAndRenderChart()\n this.firstRender = false\n }\n }\n\n componentDidUpdate (prevProps: EmbeddableProps<T>) {\n if (didPropsChange(this.props, prevProps) && this.chart) {\n this.destroyChart()\n this.createAndRenderChart()\n }\n }\n\n getChartUrl () {\n return this.props.chartJsUrl.replace('{region}', this.props.region)\n }\n\n async createAndRenderChart () {\n const seatsio = await this.loadSeatsio()\n const config = this.extractConfigFromProps()\n config.container = this.container.current\n this.chart = this.createChart(seatsio, config).render()\n if (this.props.onRenderStarted) {\n this.props.onRenderStarted(this.chart)\n }\n }\n\n extractConfigFromProps (): any {\n let { chartJsUrl, divId, onRenderStarted, region, ...config } = this.props\n return config\n }\n\n componentWillUnmount () {\n this.destroyChart()\n }\n\n destroyChart () {\n if (this.chart && (this.chart as any).state !== 'DESTROYED') {\n this.chart.destroy()\n }\n }\n\n loadSeatsio (): Promise<Seatsio> {\n const chartUrl = this.getChartUrl()\n if (!Embeddable.seatsioBundles[chartUrl]) {\n Embeddable.seatsioBundles[chartUrl] = new Promise<Seatsio>((resolve, reject) => {\n const script = document.head.appendChild(document.createElement('script'))\n // Seatsio global is not replaced if already present, which would cause the wrong region bundle to resolve when changing region\n window.seatsio = undefined\n script.onload = () => {\n resolve(seatsio)\n }\n script.onerror = () => reject(`Could not load ${script.src}`)\n script.src = chartUrl\n })\n }\n\n return Embeddable.seatsioBundles[chartUrl]\n }\n\n render (): React.ReactNode {\n return (\n <div ref={this.container as unknown as React.RefObject<HTMLDivElement>} style={{'height': '100%', 'width': '100%'}} />\n )\n }\n}","import { BoothProps, GeneralAdmissionAreaProps, InteractiveObjectProps, InteractiveSectionProps, SeatProps, SelectableObjectProps, TableProps } from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObjectProps): obj is SeatProps => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObjectProps): obj is TableProps => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObjectProps): obj is InteractiveSectionProps => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObjectProps): obj is BoothProps => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObjectProps): obj is GeneralAdmissionAreaProps => obj.objectType === 'GeneralAdmissionArea'","import Embeddable from './Embeddable'\nimport { ChartDesignerConfigOptions, Seatsio } from '@seatsio/seatsio-types'\n\nexport default class SeatsioDesigner extends Embeddable<ChartDesignerConfigOptions> {\n createChart (seatsio: Seatsio, config: ChartDesignerConfigOptions) {\n return new seatsio.SeatingChartDesigner(config)\n }\n}","import { EventManagerConfigOptions, Seatsio } from '@seatsio/seatsio-types'\nimport Embeddable from './Embeddable'\n\nexport default class SeatsioEventManager extends Embeddable<EventManagerConfigOptions> {\n createChart (seatsio: Seatsio, config: EventManagerConfigOptions) {\n return new seatsio.EventManager(config)\n }\n}","import { ChartRendererConfigOptions, Seatsio } from '@seatsio/seatsio-types'\nimport Embeddable from './Embeddable'\n\nexport default class SeatsioSeatingChart extends Embeddable<ChartRendererConfigOptions> {\n createChart (seatsio: Seatsio, config: ChartRendererConfigOptions) {\n return new seatsio.SeatingChart(config)\n }\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;;;ACEhB,IAAM,iBAAiB,CAAkC,WAAc,cAA0B;AACpG,MAAI,OAAO,KAAK,SAAS,EAAE,WAAW,OAAO,KAAK,SAAS,EAAE,QAAQ;AACjE,WAAO;AAAA,EACX;AACA,SAAO,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,aAAqB;AACrD,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,aAAa,WAAW;AACxB,UAAI,OAAO,cAAc,cAAc,OAAO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,sBAArB,cAAiD,WAAuC;AAAA,EACpF,YAAaC,UAAkB,QAAoC;AAC/D,WAAO,IAAIA,SAAQ,aAAa,MAAM;AAAA,EAC1C;AACJ;","names":["seatsio","seatsio","seatsio","seatsio"]}
1
+ {"version":3,"sources":["../src/main/index.ts","../src/main/Embeddable.tsx","../src/main/util.ts","../src/main/SeatsioDesigner.tsx","../src/main/SeatsioEventManager.tsx","../src/main/SeatsioSeatingChart.tsx"],"sourcesContent":["export { default as SeatsioDesigner } from './SeatsioDesigner'\nexport { default as SeatsioEventManager } from './SeatsioEventManager'\nexport { default as SeatsioSeatingChart } from './SeatsioSeatingChart'\nexport { isBooth, isGeneralAdmission, isSeat, isSection, isTable } from './util'\nexport type * from '@seatsio/seatsio-types';\n","import * as React from 'react'\nimport {didPropsChange} from './util'\nimport { ChartDesigner, CommonConfigOptions, EventManager, Region, SeatingChart, Seatsio } from '@seatsio/seatsio-types'\n\nexport type EmbeddableProps<T > = {\n onRenderStarted?: (chart: SeatingChart | EventManager) => void\n chartJsUrl?: string\n region: Region\n} & T\n\nexport default abstract class Embeddable<T extends CommonConfigOptions> extends React.Component<EmbeddableProps<T>> {\n private container: React.RefObject<HTMLDivElement>\n private chart: SeatingChart\n private firstRender: boolean\n\n private static seatsioBundles: { [key: string]: Promise<Seatsio> } = {}\n\n static defaultProps = {\n chartJsUrl: 'https://cdn-{region}.seatsio.net/chart.js'\n }\n\n constructor(props: EmbeddableProps<T>) {\n super(props);\n this.container = React.createRef()\n this.firstRender = true\n }\n\n abstract createChart (seatsio: Seatsio, config: T): SeatingChart | EventManager | ChartDesigner\n\n componentDidMount () {\n if (!Embeddable.seatsioBundles[this.getChartUrl()] || this.firstRender) {\n this.createAndRenderChart()\n this.firstRender = false\n }\n }\n\n componentDidUpdate (prevProps: EmbeddableProps<T>) {\n if (didPropsChange(this.props, prevProps) && this.chart) {\n this.destroyChart()\n this.createAndRenderChart()\n }\n }\n\n getChartUrl () {\n return this.props.chartJsUrl.replace('{region}', this.props.region)\n }\n\n async createAndRenderChart () {\n const seatsio = await this.loadSeatsio()\n const config = this.extractConfigFromProps()\n config.container = this.container.current\n this.chart = this.createChart(seatsio, config).render()\n if (this.props.onRenderStarted) {\n this.props.onRenderStarted(this.chart)\n }\n }\n\n extractConfigFromProps (): any {\n let { chartJsUrl, divId, onRenderStarted, region, ...config } = this.props\n return config\n }\n\n componentWillUnmount () {\n this.destroyChart()\n }\n\n destroyChart () {\n if (this.chart && (this.chart as any).state !== 'DESTROYED') {\n this.chart.destroy()\n }\n }\n\n loadSeatsio (): Promise<Seatsio> {\n const chartUrl = this.getChartUrl()\n if (!Embeddable.seatsioBundles[chartUrl]) {\n Embeddable.seatsioBundles[chartUrl] = new Promise<Seatsio>((resolve, reject) => {\n const script = document.head.appendChild(document.createElement('script'))\n // Seatsio global is not replaced if already present, which would cause the wrong region bundle to resolve when changing region\n window.seatsio = undefined\n script.onload = () => {\n resolve(seatsio)\n }\n script.onerror = () => reject(`Could not load ${script.src}`)\n script.src = chartUrl\n })\n }\n\n return Embeddable.seatsioBundles[chartUrl]\n }\n\n render (): React.ReactNode {\n return (\n <div ref={this.container as unknown as React.RefObject<HTMLDivElement>} style={{'height': '100%', 'width': '100%'}} />\n )\n }\n}","import {Booth, GeneralAdmissionArea, InteractiveSection, Seat, SelectableObject, Table} from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObject) => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObject): obj is Table => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObject): obj is InteractiveSection => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObject): obj is Booth => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObject): obj is GeneralAdmissionArea => obj.objectType === 'GeneralAdmissionArea'\n","import Embeddable from './Embeddable'\nimport { ChartDesignerConfigOptions, Seatsio } from '@seatsio/seatsio-types'\n\nexport default class SeatsioDesigner extends Embeddable<ChartDesignerConfigOptions> {\n createChart (seatsio: Seatsio, config: ChartDesignerConfigOptions) {\n return new seatsio.SeatingChartDesigner(config)\n }\n}","import { EventManagerConfigOptions, Seatsio } from '@seatsio/seatsio-types'\nimport Embeddable from './Embeddable'\n\nexport default class SeatsioEventManager extends Embeddable<EventManagerConfigOptions> {\n createChart (seatsio: Seatsio, config: EventManagerConfigOptions) {\n return new seatsio.EventManager(config)\n }\n}","import { ChartRendererConfigOptions, Seatsio } from '@seatsio/seatsio-types'\nimport Embeddable from './Embeddable'\n\nexport default class SeatsioSeatingChart extends Embeddable<ChartRendererConfigOptions> {\n createChart (seatsio: Seatsio, config: ChartRendererConfigOptions) {\n return new seatsio.SeatingChart(config)\n }\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;;;ACEhB,IAAM,iBAAiB,CAAkC,WAAc,cAA0B;AACpG,MAAI,OAAO,KAAK,SAAS,EAAE,WAAW,OAAO,KAAK,SAAS,EAAE,QAAQ;AACjE,WAAO;AAAA,EACX;AACA,SAAO,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,aAAqB;AACrD,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,aAAa,WAAW;AACxB,UAAI,OAAO,cAAc,cAAc,OAAO,cAAc,YAAY;AACpE,e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WAAuC;AAAA,EACpF,YAAaC,UAAkB,QAAoC;AAC/D,WAAO,IAAIA,SAAQ,aAAa,MAAM;AAAA,EAC1C;AACJ;","names":["seatsio","seatsio","seatsio","seatsio"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/main/Embeddable.tsx","../src/main/util.ts","../src/main/SeatsioDesigner.tsx","../src/main/SeatsioEventManager.tsx","../src/main/SeatsioSeatingChart.tsx"],"sourcesContent":["import * as React from 'react'\nimport {didPropsChange} from './util'\nimport { ChartDesigner, CommonConfigOptions, EventManager, Region, SeatingChart, Seatsio } from '@seatsio/seatsio-types'\n\nexport type EmbeddableProps<T > = {\n onRenderStarted?: (chart: SeatingChart | EventManager) => void\n chartJsUrl?: string\n region: Region\n} & T\n\nexport default abstract class Embeddable<T extends CommonConfigOptions> extends React.Component<EmbeddableProps<T>> {\n private container: React.RefObject<HTMLDivElement>\n private chart: SeatingChart\n private firstRender: boolean\n\n private static seatsioBundles: { [key: string]: Promise<Seatsio> } = {}\n\n static defaultProps = {\n chartJsUrl: 'https://cdn-{region}.seatsio.net/chart.js'\n }\n\n constructor(props: EmbeddableProps<T>) {\n super(props);\n this.container = React.createRef()\n this.firstRender = true\n }\n\n abstract createChart (seatsio: Seatsio, config: T): SeatingChart | EventManager | ChartDesigner\n\n componentDidMount () {\n if (!Embeddable.seatsioBundles[this.getChartUrl()] || this.firstRender) {\n this.createAndRenderChart()\n this.firstRender = false\n }\n }\n\n componentDidUpdate (prevProps: EmbeddableProps<T>) {\n if (didPropsChange(this.props, prevProps) && this.chart) {\n this.destroyChart()\n this.createAndRenderChart()\n }\n }\n\n getChartUrl () {\n return this.props.chartJsUrl.replace('{region}', this.props.region)\n }\n\n async createAndRenderChart () {\n const seatsio = await this.loadSeatsio()\n const config = this.extractConfigFromProps()\n config.container = this.container.current\n this.chart = this.createChart(seatsio, config).render()\n if (this.props.onRenderStarted) {\n this.props.onRenderStarted(this.chart)\n }\n }\n\n extractConfigFromProps (): any {\n let { chartJsUrl, divId, onRenderStarted, region, ...config } = this.props\n return config\n }\n\n componentWillUnmount () {\n this.destroyChart()\n }\n\n destroyChart () {\n if (this.chart && (this.chart as any).state !== 'DESTROYED') {\n this.chart.destroy()\n }\n }\n\n loadSeatsio (): Promise<Seatsio> {\n const chartUrl = this.getChartUrl()\n if (!Embeddable.seatsioBundles[chartUrl]) {\n Embeddable.seatsioBundles[chartUrl] = new Promise<Seatsio>((resolve, reject) => {\n const script = document.head.appendChild(document.createElement('script'))\n // Seatsio global is not replaced if already present, which would cause the wrong region bundle to resolve when changing region\n window.seatsio = undefined\n script.onload = () => {\n resolve(seatsio)\n }\n script.onerror = () => reject(`Could not load ${script.src}`)\n script.src = chartUrl\n })\n }\n\n return Embeddable.seatsioBundles[chartUrl]\n }\n\n render (): React.ReactNode {\n return (\n <div ref={this.container as unknown as React.RefObject<HTMLDivElement>} style={{'height': '100%', 'width': '100%'}} />\n )\n }\n}","import { BoothProps, GeneralAdmissionAreaProps, InteractiveObjectProps, InteractiveSectionProps, SeatProps, SelectableObjectProps, TableProps } from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObjectProps): obj is SeatProps => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObjectProps): obj is TableProps => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObjectProps): obj is InteractiveSectionProps => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObjectProps): obj is BoothProps => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObjectProps): obj is GeneralAdmissionAreaProps => obj.objectType === 'GeneralAdmissionArea'","import Embeddable from './Embeddable'\nimport { ChartDesignerConfigOptions, Seatsio } from '@seatsio/seatsio-types'\n\nexport default class SeatsioDesigner extends Embeddable<ChartDesignerConfigOptions> {\n createChart (seatsio: Seatsio, config: ChartDesignerConfigOptions) {\n return new seatsio.SeatingChartDesigner(config)\n }\n}","import { EventManagerConfigOptions, Seatsio } from '@seatsio/seatsio-types'\nimport Embeddable from './Embeddable'\n\nexport default class SeatsioEventManager extends Embeddable<EventManagerConfigOptions> {\n createChart (seatsio: Seatsio, config: EventManagerConfigOptions) {\n return new seatsio.EventManager(config)\n }\n}","import { ChartRendererConfigOptions, Seatsio } from '@seatsio/seatsio-types'\nimport Embeddable from './Embeddable'\n\nexport default class SeatsioSeatingChart extends Embeddable<ChartRendererConfigOptions> {\n createChart (seatsio: Seatsio, config: ChartRendererConfigOptions) {\n return new seatsio.SeatingChart(config)\n }\n}"],"mappings":";AAAA,YAAY,WAAW;;;ACEhB,IAAM,iBAAiB,CAAkC,WAAc,cAA0B;AACpG,MAAI,OAAO,KAAK,SAAS,EAAE,WAAW,OAAO,KAAK,SAAS,EAAE,QAAQ;AACjE,WAAO;AAAA,EACX;AACA,SAAO,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,aAAqB;AACrD,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,aAAa,WAAW;AACxB,UAAI,OAAO,cAAc,cAAc,OAAO,cAAc,YAAY;AACpE,eAAO,UAAU,SAAS,MAAM,UAAU,SAAS;AAAA,MACvD;AACA,UAAI,OAAO,cAAc,YAAY,OAAO,cAAc,UAAU;AAChE,eAAO,eAAe,WAAW,SAAS;AAAA,MAC9C;AAAA,IACJ;AACA,WAAO,cAAc;AAAA,EACzB,CAAC;AACL;AAEO,IAAM,SAAS,CAAC,QAAiD,IAAI,eA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D,WAAK,MAAM,QAAQ;AAAA,IACvB;AAAA,EACJ;AAAA,EAEA,cAAiC;AAC7B,UAAM,WAAW,KAAK,YAAY;AAClC,QAAI,CAAC,YAAW,eAAe,QAAQ,GAAG;AACtC,kBAAW,eAAe,QAAQ,IAAI,IAAI,QAAiB,CAAC,SAAS,WAAW;AAC5E,cAAM,SAAS,SAAS,KAAK,YAAY,SAAS,cAAc,QAAQ,CAAC;AAEzE,eAAO,UAAU;AACjB,eAAO,SAAS,MAAM;AAClB,kBAAQ,OAAO;AAAA,QACnB;AACA,eAAO,UAAU,MAAM,OAAO,kBAAkB,OAAO,GAAG,EAAE;AAC5D,eAAO,MAAM;AAAA,MACjB,CAAC;AAAA,IACL;AAEA,WAAO,YAAW,eAAe,QAAQ;AAAA,EAC7C;AAAA,EAEA,SAA2B;AACvB,WACI,oCAAC,SAAI,KAAK,KAAK,WAAyD,OAAO,EAAC,UAAU,QAAQ,SAAS,OAAM,GAAG;AAAA,EAE5H;AACJ;AArF8B,YAKX,iBAAsD,CAAC;AAL5C,YAOnB,eAAe;AAAA,EAClB,YAAY;AAChB;AATJ,IAA8B,aAA9B;;;AEPA,IAAqB,kBAArB,cAA6C,WAAuC;AAAA,EAChF,YAAaC,UAAkB,QAAoC;AAC/D,WAAO,IAAIA,SAAQ,qBAAqB,MAAM;AAAA,EAClD;AACJ;;;ACJA,IAAqB,sBAArB,cAAiD,WAAsC;AAAA,EACnF,YAAaC,UAAkB,QAAmC;AAC9D,WAAO,IAAIA,SAAQ,aAAa,MAAM;AAAA,EAC1C;AACJ;;;ACJA,IAAqB,sBAArB,cAAiD,WAAuC;AAAA,EACpF,YAAaC,UAAkB,QAAoC;AAC/D,WAAO,IAAIA,SAAQ,aAAa,MAAM;AAAA,EAC1C;AACJ;","names":["seatsio","seatsio","seatsio","seatsio"]}
1
+ {"version":3,"sources":["../src/main/Embeddable.tsx","../src/main/util.ts","../src/main/SeatsioDesigner.tsx","../src/main/SeatsioEventManager.tsx","../src/main/SeatsioSeatingChart.tsx"],"sourcesContent":["import * as React from 'react'\nimport {didPropsChange} from './util'\nimport { ChartDesigner, CommonConfigOptions, EventManager, Region, SeatingChart, Seatsio } from '@seatsio/seatsio-types'\n\nexport type EmbeddableProps<T > = {\n onRenderStarted?: (chart: SeatingChart | EventManager) => void\n chartJsUrl?: string\n region: Region\n} & T\n\nexport default abstract class Embeddable<T extends CommonConfigOptions> extends React.Component<EmbeddableProps<T>> {\n private container: React.RefObject<HTMLDivElement>\n private chart: SeatingChart\n private firstRender: boolean\n\n private static seatsioBundles: { [key: string]: Promise<Seatsio> } = {}\n\n static defaultProps = {\n chartJsUrl: 'https://cdn-{region}.seatsio.net/chart.js'\n }\n\n constructor(props: EmbeddableProps<T>) {\n super(props);\n this.container = React.createRef()\n this.firstRender = true\n }\n\n abstract createChart (seatsio: Seatsio, config: T): SeatingChart | EventManager | ChartDesigner\n\n componentDidMount () {\n if (!Embeddable.seatsioBundles[this.getChartUrl()] || this.firstRender) {\n this.createAndRenderChart()\n this.firstRender = false\n }\n }\n\n componentDidUpdate (prevProps: EmbeddableProps<T>) {\n if (didPropsChange(this.props, prevProps) && this.chart) {\n this.destroyChart()\n this.createAndRenderChart()\n }\n }\n\n getChartUrl () {\n return this.props.chartJsUrl.replace('{region}', this.props.region)\n }\n\n async createAndRenderChart () {\n const seatsio = await this.loadSeatsio()\n const config = this.extractConfigFromProps()\n config.container = this.container.current\n this.chart = this.createChart(seatsio, config).render()\n if (this.props.onRenderStarted) {\n this.props.onRenderStarted(this.chart)\n }\n }\n\n extractConfigFromProps (): any {\n let { chartJsUrl, divId, onRenderStarted, region, ...config } = this.props\n return config\n }\n\n componentWillUnmount () {\n this.destroyChart()\n }\n\n destroyChart () {\n if (this.chart && (this.chart as any).state !== 'DESTROYED') {\n this.chart.destroy()\n }\n }\n\n loadSeatsio (): Promise<Seatsio> {\n const chartUrl = this.getChartUrl()\n if (!Embeddable.seatsioBundles[chartUrl]) {\n Embeddable.seatsioBundles[chartUrl] = new Promise<Seatsio>((resolve, reject) => {\n const script = document.head.appendChild(document.createElement('script'))\n // Seatsio global is not replaced if already present, which would cause the wrong region bundle to resolve when changing region\n window.seatsio = undefined\n script.onload = () => {\n resolve(seatsio)\n }\n script.onerror = () => reject(`Could not load ${script.src}`)\n script.src = chartUrl\n })\n }\n\n return Embeddable.seatsioBundles[chartUrl]\n }\n\n render (): React.ReactNode {\n return (\n <div ref={this.container as unknown as React.RefObject<HTMLDivElement>} style={{'height': '100%', 'width': '100%'}} />\n )\n }\n}","import {Booth, GeneralAdmissionArea, InteractiveSection, Seat, SelectableObject, Table} from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObject) => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObject): obj is Table => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObject): obj is InteractiveSection => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObject): obj is Booth => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObject): obj is GeneralAdmissionArea => obj.objectType === 'GeneralAdmissionArea'\n","import Embeddable from './Embeddable'\nimport { ChartDesignerConfigOptions, Seatsio } from '@seatsio/seatsio-types'\n\nexport default class SeatsioDesigner extends Embeddable<ChartDesignerConfigOptions> {\n createChart (seatsio: Seatsio, config: ChartDesignerConfigOptions) {\n return new seatsio.SeatingChartDesigner(config)\n }\n}","import { EventManagerConfigOptions, Seatsio } from '@seatsio/seatsio-types'\nimport Embeddable from './Embeddable'\n\nexport default class SeatsioEventManager extends Embeddable<EventManagerConfigOptions> {\n createChart (seatsio: Seatsio, config: EventManagerConfigOptions) {\n return new seatsio.EventManager(config)\n }\n}","import { ChartRendererConfigOptions, Seatsio } from '@seatsio/seatsio-types'\nimport Embeddable from './Embeddable'\n\nexport default class SeatsioSeatingChart extends Embeddable<ChartRendererConfigOptions> {\n createChart (seatsio: Seatsio, config: ChartRendererConfigOptions) {\n return new seatsio.SeatingChart(config)\n }\n}"],"mappings":";AAAA,YAAY,WAAW;;;ACEhB,IAAM,iBAAiB,CAAkC,WAAc,cAA0B;AACpG,MAAI,OAAO,KAAK,SAAS,EAAE,WAAW,OAAO,KAAK,SAAS,EAAE,QAAQ;AACjE,WAAO;AAAA,EACX;AACA,SAAO,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,aAAqB;AACrD,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,aAAa,WAAW;AACxB,UAAI,OAAO,cAAc,cAAc,OAAO,cAAc,YAAY;AACpE,eAAO,UAAU,SAAS,MAAM,UAAU,SAAS;AAAA,MACvD;AACA,UAAI,OAAO,cAAc,YAAY,OAAO,cAAc,UAAU;AAChE,eAAO,eAAe,WAAW,SAAS;AAAA,MAC9C;AAAA,IACJ;AACA,WAAO,cAAc;AAAA,EACzB,CAAC;AACL;AAEO,IAAM,SAAS,CAAC,QAA0B,IAAI,eAAe;AAC7D,IAAM,UAAU,CAAC,QAAwC,IAAI,eAAe;AAC5E,IAAM,YAAY,CAAC,QAAqD,IAAI,eAAe;AAC3F,IAAM,UAAU,CAAC,QAAwC,IAAI,eAAe;AAC5E,IAAM,qBAAqB,CAAC,QAAuD,IAAI,eAAe;;;ADf7G,IAA8B,cAA9B,MAA8B,oBAAwD,gBAA8B;AAAA,EAWhH,YAAY,OAA2B;AACnC,UAAM,KAAK;AACX,SAAK,YAAkB,gBAAU;AACjC,SAAK,c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AClB,kBAAQ,OAAO;AAAA,QACnB;AACA,eAAO,UAAU,MAAM,OAAO,kBAAkB,OAAO,GAAG,EAAE;AAC5D,eAAO,MAAM;AAAA,MACjB,CAAC;AAAA,IACL;AAEA,WAAO,YAAW,eAAe,QAAQ;AAAA,EAC7C;AAAA,EAEA,SAA2B;AACvB,WACI,oCAAC,SAAI,KAAK,KAAK,WAAyD,OAAO,EAAC,UAAU,QAAQ,SAAS,OAAM,GAAG;AAAA,EAE5H;AACJ;AArF8B,YAKX,iBAAsD,CAAC;AAL5C,YAOnB,eAAe;AAAA,EAClB,YAAY;AAChB;AATJ,IAA8B,aAA9B;;;AEPA,IAAqB,kBAArB,cAA6C,WAAuC;AAAA,EAChF,YAAaC,UAAkB,QAAoC;AAC/D,WAAO,IAAIA,SAAQ,qBAAqB,MAAM;AAAA,EAClD;AACJ;;;ACJA,IAAqB,sBAArB,cAAiD,WAAsC;AAAA,EACnF,YAAaC,UAAkB,QAAmC;AAC9D,WAAO,IAAIA,SAAQ,aAAa,MAAM;AAAA,EAC1C;AACJ;;;ACJA,IAAqB,sBAArB,cAAiD,WAAuC;AAAA,EACpF,YAAaC,UAAkB,QAAoC;AAC/D,WAAO,IAAIA,SAAQ,aAAa,MAAM;AAAA,EAC1C;AACJ;","names":["seatsio","seatsio","seatsio","seatsio"]}
package/build/util.d.mts CHANGED
@@ -1,12 +1,12 @@
1
- import { SelectableObjectProps, SeatProps, TableProps, InteractiveSectionProps, BoothProps, GeneralAdmissionAreaProps } from '@seatsio/seatsio-types';
1
+ import { SelectableObject, Table, InteractiveSection, Booth, GeneralAdmissionArea } from '@seatsio/seatsio-types';
2
2
 
3
3
  declare const didPropsChange: <P extends {
4
4
  [key: string]: any;
5
5
  }>(prevProps: P, nextProps: P) => boolean;
6
- declare const isSeat: (obj: SelectableObjectProps) => obj is SeatProps;
7
- declare const isTable: (obj: SelectableObjectProps) => obj is TableProps;
8
- declare const isSection: (obj: SelectableObjectProps) => obj is InteractiveSectionProps;
9
- declare const isBooth: (obj: SelectableObjectProps) => obj is BoothProps;
10
- declare const isGeneralAdmission: (obj: SelectableObjectProps) => obj is GeneralAdmissionAreaProps;
6
+ declare const isSeat: (obj: SelectableObject) => boolean;
7
+ declare const isTable: (obj: SelectableObject) => obj is Table;
8
+ declare const isSection: (obj: SelectableObject) => obj is InteractiveSection;
9
+ declare const isBooth: (obj: SelectableObject) => obj is Booth;
10
+ declare const isGeneralAdmission: (obj: SelectableObject) => obj is GeneralAdmissionArea;
11
11
 
12
12
  export { didPropsChange, isBooth, isGeneralAdmission, isSeat, isSection, isTable };
package/build/util.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- import { SelectableObjectProps, SeatProps, TableProps, InteractiveSectionProps, BoothProps, GeneralAdmissionAreaProps } from '@seatsio/seatsio-types';
1
+ import { SelectableObject, Table, InteractiveSection, Booth, GeneralAdmissionArea } from '@seatsio/seatsio-types';
2
2
 
3
3
  declare const didPropsChange: <P extends {
4
4
  [key: string]: any;
5
5
  }>(prevProps: P, nextProps: P) => boolean;
6
- declare const isSeat: (obj: SelectableObjectProps) => obj is SeatProps;
7
- declare const isTable: (obj: SelectableObjectProps) => obj is TableProps;
8
- declare const isSection: (obj: SelectableObjectProps) => obj is InteractiveSectionProps;
9
- declare const isBooth: (obj: SelectableObjectProps) => obj is BoothProps;
10
- declare const isGeneralAdmission: (obj: SelectableObjectProps) => obj is GeneralAdmissionAreaProps;
6
+ declare const isSeat: (obj: SelectableObject) => boolean;
7
+ declare const isTable: (obj: SelectableObject) => obj is Table;
8
+ declare const isSection: (obj: SelectableObject) => obj is InteractiveSection;
9
+ declare const isBooth: (obj: SelectableObject) => obj is Booth;
10
+ declare const isGeneralAdmission: (obj: SelectableObject) => obj is GeneralAdmissionArea;
11
11
 
12
12
  export { didPropsChange, isBooth, isGeneralAdmission, isSeat, isSection, isTable };
package/build/util.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/main/util.ts"],"sourcesContent":["import { BoothProps, GeneralAdmissionAreaProps, InteractiveObjectProps, InteractiveSectionProps, SeatProps, SelectableObjectProps, TableProps } from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObjectProps): obj is SeatProps => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObjectProps): obj is TableProps => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObjectProps): obj is InteractiveSectionProps => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObjectProps): obj is BoothProps => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObjectProps): obj is GeneralAdmissionAreaProps => obj.objectType === 'GeneralAdmissionArea'"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,IAAM,iBAAiB,CAAkC,WAAc,cAA0B;AACpG,MAAI,OAAO,KAAK,SAAS,EAAE,WAAW,OAAO,KAAK,SAAS,EAAE,QAAQ;AACjE,WAAO;AAAA,EACX;AACA,SAAO,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,aAAqB;AACrD,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,aAAa,WAAW;AACxB,UAAI,OAAO,cAAc,cAAc,OAAO,cAAc,YAAY;AACpE,eAAO,UAAU,SAAS,MAAM,UAAU,SAAS;AAAA,MACvD;AACA,UAAI,OAAO,cAAc,YAAY,OAAO,cAAc,UAAU;AAChE,eAAO,eAAe,WAAW,SAAS;AAAA,MAC9C;AAAA,IACJ;AACA,WAAO,cAAc;AAAA,EACzB,CAAC;AACL;AAEO,IAAM,SAAS,CAAC,QAAiD,IAAI,eAAe;AACpF,IAAM,UAAU,CAAC,QAAkD,IAAI,eAAe;AACtF,IAAM,YAAY,CAAC,QAA+D,IAAI,eAAe;AACrG,IAAM,UAAU,CAAC,QAAkD,IAAI,eAAe;AACtF,IAAM,qBAAqB,CAAC,QAAiE,IAAI,eAAe;","names":[]}
1
+ {"version":3,"sources":["../src/main/util.ts"],"sourcesContent":["import {Booth, GeneralAdmissionArea, InteractiveSection, Seat, SelectableObject, Table} from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObject) => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObject): obj is Table => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObject): obj is InteractiveSection => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObject): obj is Booth => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObject): obj is GeneralAdmissionArea => obj.objectType === 'GeneralAdmissionArea'\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,IAAM,iBAAiB,CAAkC,WAAc,cAA0B;AACpG,MAAI,OAAO,KAAK,SAAS,EAAE,WAAW,OAAO,KAAK,SAAS,EAAE,QAAQ;AACjE,WAAO;AAAA,EACX;AACA,SAAO,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,aAAqB;AACrD,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,aAAa,WAAW;AACxB,UAAI,OAAO,cAAc,cAAc,OAAO,cAAc,YAAY;AACpE,eAAO,UAAU,SAAS,MAAM,UAAU,SAAS;AAAA,MACvD;AACA,UAAI,OAAO,cAAc,YAAY,OAAO,cAAc,UAAU;AAChE,eAAO,eAAe,WAAW,SAAS;AAAA,MAC9C;AAAA,IACJ;AACA,WAAO,cAAc;AAAA,EACzB,CAAC;AACL;AAEO,IAAM,SAAS,CAAC,QAA0B,IAAI,eAAe;AAC7D,IAAM,UAAU,CAAC,QAAwC,IAAI,eAAe;AAC5E,IAAM,YAAY,CAAC,QAAqD,IAAI,eAAe;AAC3F,IAAM,UAAU,CAAC,QAAwC,IAAI,eAAe;AAC5E,IAAM,qBAAqB,CAAC,QAAuD,IAAI,eAAe;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/main/util.ts"],"sourcesContent":["import { BoothProps, GeneralAdmissionAreaProps, InteractiveObjectProps, InteractiveSectionProps, SeatProps, SelectableObjectProps, TableProps } from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObjectProps): obj is SeatProps => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObjectProps): obj is TableProps => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObjectProps): obj is InteractiveSectionProps => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObjectProps): obj is BoothProps => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObjectProps): obj is GeneralAdmissionAreaProps => obj.objectType === 'GeneralAdmissionArea'"],"mappings":";AAEO,IAAM,iBAAiB,CAAkC,WAAc,cAA0B;AACpG,MAAI,OAAO,KAAK,SAAS,EAAE,WAAW,OAAO,KAAK,SAAS,EAAE,QAAQ;AACjE,WAAO;AAAA,EACX;AACA,SAAO,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,aAAqB;AACrD,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,aAAa,WAAW;AACxB,UAAI,OAAO,cAAc,cAAc,OAAO,cAAc,YAAY;AACpE,eAAO,UAAU,SAAS,MAAM,UAAU,SAAS;AAAA,MACvD;AACA,UAAI,OAAO,cAAc,YAAY,OAAO,cAAc,UAAU;AAChE,eAAO,eAAe,WAAW,SAAS;AAAA,MAC9C;AAAA,IACJ;AACA,WAAO,cAAc;AAAA,EACzB,CAAC;AACL;AAEO,IAAM,SAAS,CAAC,QAAiD,IAAI,eAAe;AACpF,IAAM,UAAU,CAAC,QAAkD,IAAI,eAAe;AACtF,IAAM,YAAY,CAAC,QAA+D,IAAI,eAAe;AACrG,IAAM,UAAU,CAAC,QAAkD,IAAI,eAAe;AACtF,IAAM,qBAAqB,CAAC,QAAiE,IAAI,eAAe;","names":[]}
1
+ {"version":3,"sources":["../src/main/util.ts"],"sourcesContent":["import {Booth, GeneralAdmissionArea, InteractiveSection, Seat, SelectableObject, Table} from \"@seatsio/seatsio-types\"\n\nexport const didPropsChange = <P extends { [key: string]: any}>(prevProps: P, nextProps: P): boolean => {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return true\n }\n return Object.keys(nextProps).some((propName: string) => {\n let prevValue = prevProps[propName]\n let nextValue = nextProps[propName]\n if (prevValue && nextValue) {\n if (typeof prevValue === 'function' && typeof nextValue === 'function') {\n return prevValue.toString() !== nextValue.toString()\n }\n if (typeof prevValue === 'object' && typeof nextValue === 'object') {\n return didPropsChange(prevValue, nextValue)\n }\n }\n return prevValue !== nextValue\n })\n}\n\nexport const isSeat = (obj: SelectableObject) => obj.objectType === 'Seat'\nexport const isTable = (obj: SelectableObject): obj is Table => obj.objectType === 'Table'\nexport const isSection = (obj: SelectableObject): obj is InteractiveSection => obj.objectType === 'section'\nexport const isBooth = (obj: SelectableObject): obj is Booth => obj.objectType === 'Booth'\nexport const isGeneralAdmission = (obj: SelectableObject): obj is GeneralAdmissionArea => obj.objectType === 'GeneralAdmissionArea'\n"],"mappings":";AAEO,IAAM,iBAAiB,CAAkC,WAAc,cAA0B;AACpG,MAAI,OAAO,KAAK,SAAS,EAAE,WAAW,OAAO,KAAK,SAAS,EAAE,QAAQ;AACjE,WAAO;AAAA,EACX;AACA,SAAO,OAAO,KAAK,SAAS,EAAE,KAAK,CAAC,aAAqB;AACrD,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,YAAY,UAAU,QAAQ;AAClC,QAAI,aAAa,WAAW;AACxB,UAAI,OAAO,cAAc,cAAc,OAAO,cAAc,YAAY;AACpE,eAAO,UAAU,SAAS,MAAM,UAAU,SAAS;AAAA,MACvD;AACA,UAAI,OAAO,cAAc,YAAY,OAAO,cAAc,UAAU;AAChE,eAAO,eAAe,WAAW,SAAS;AAAA,MAC9C;AAAA,IACJ;AACA,WAAO,cAAc;AAAA,EACzB,CAAC;AACL;AAEO,IAAM,SAAS,CAAC,QAA0B,IAAI,eAAe;AAC7D,IAAM,UAAU,CAAC,QAAwC,IAAI,eAAe;AAC5E,IAAM,YAAY,CAAC,QAAqD,IAAI,eAAe;AAC3F,IAAM,UAAU,CAAC,QAAwC,IAAI,eAAe;AAC5E,IAAM,qBAAqB,CAAC,QAAuD,IAAI,eAAe;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seatsio/seatsio-react",
3
- "version": "14.12.0",
3
+ "version": "14.13.0",
4
4
  "main": "build/index.js",
5
5
  "module": "build/index.mjs",
6
6
  "types": "build/index.d.ts",
@@ -25,17 +25,17 @@
25
25
  "build/"
26
26
  ],
27
27
  "dependencies": {
28
- "@seatsio/seatsio-types": "2.8.0"
28
+ "@seatsio/seatsio-types": "3.1.0"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "react": ">=18.0.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@testing-library/jest-dom": "6.4.2",
35
- "@testing-library/react": "14.2.1",
35
+ "@testing-library/react": "14.2.2",
36
36
  "@types/jest": "29.5.12",
37
- "@types/react": "18.2.61",
38
- "@types/react-dom": "18.2.19",
37
+ "@types/react": "18.2.74",
38
+ "@types/react-dom": "18.2.23",
39
39
  "jest": "29.7.0",
40
40
  "jest-environment-jsdom": "29.7.0",
41
41
  "react": "18.2.0",
@@ -43,6 +43,6 @@
43
43
  "rimraf": "5.0.5",
44
44
  "ts-jest": "29.1.2",
45
45
  "tsup": "8.0.2",
46
- "typescript": "5.3.3"
46
+ "typescript": "5.4.3"
47
47
  }
48
48
  }