@vixoniccom/menu-daily 0.1.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.
Files changed (33) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/assets/framed.ai +3330 -4
  3. package/assets/modern.ai +421 -0
  4. package/build.zip +0 -0
  5. package/configuration.json +207 -0
  6. package/icon.png +0 -0
  7. package/package.json +31 -0
  8. package/src/dataLoader.ts +168 -0
  9. package/src/global.d.ts +59 -0
  10. package/src/index.html +33 -0
  11. package/src/logger.ts +11 -0
  12. package/src/main.ts +47 -0
  13. package/src/scenes/App.tsx +103 -0
  14. package/src/scenes/components/FontLoader.tsx +52 -0
  15. package/src/scenes/components/FormattedText.tsx +56 -0
  16. package/src/scenes/components/Grid/Grid.tsx +161 -0
  17. package/src/scenes/components/Grid/GridItem.tsx +79 -0
  18. package/src/scenes/components/Grid/animation.ts +105 -0
  19. package/src/scenes/components/Grid/index.ts +2 -0
  20. package/src/scenes/components/MealContainer/components/OptionItem.tsx +25 -0
  21. package/src/scenes/components/MealContainer/components/Title/index.tsx +82 -0
  22. package/src/scenes/components/MealContainer/components/Title/styles/Framed.tsx +52 -0
  23. package/src/scenes/components/MealContainer/components/Title/styles/Modern.tsx +47 -0
  24. package/src/scenes/components/MealContainer/components/Title/styles/index.tsx +13 -0
  25. package/src/scenes/components/MealContainer/components/index.ts +2 -0
  26. package/src/scenes/components/MealContainer/index.tsx +59 -0
  27. package/src/static/menu-daily-example.xlsx +0 -0
  28. package/src/test/downloads/1234.ttf +0 -0
  29. package/src/test/downloads/background.jpg +0 -0
  30. package/src/test/downloads/futura-font.ttf +0 -0
  31. package/src/test/parameters.json +37 -0
  32. package/tsconfig.json +36 -0
  33. package/tslint.json +5 -0
@@ -0,0 +1,59 @@
1
+ import React from 'react'
2
+ import Grid from '../Grid'
3
+ import { OptionItem, Title } from './components'
4
+
5
+ type Props = {
6
+ data: Meal
7
+ vixonicData: VixonicData
8
+ interval: number
9
+ }
10
+
11
+ export default class MealContainer extends React.Component<Props, any> {
12
+ constructor () {
13
+ super ()
14
+ this.state = {}
15
+ }
16
+
17
+ render () {
18
+ let { data, interval, vixonicData } = this.props
19
+ let { parameters } = vixonicData
20
+ let rows = parameters.itemGridRows || 1
21
+ let pages = Math.ceil(data.options.length / rows)
22
+ let cycle = parameters.itemAnimationDuration && parameters.itemAnimationDuration * 1000 || (interval / pages)
23
+ return <div style={{
24
+ display: 'flex',
25
+ flexDirection: 'column',
26
+ width: '100%',
27
+ height: '100%',
28
+ flex: 1
29
+ }}>
30
+ <Title
31
+ text={data.type}
32
+ vixonicData={vixonicData}
33
+ getPadding={(padding) => this.setState({padding})} />
34
+ { data && data.options &&
35
+ <Grid
36
+ style={{
37
+ flex: 1,
38
+ padding: parameters.itemGridMargins || this.state.padding
39
+ }}
40
+ fontSize='inherit'
41
+ id={data.type}
42
+ items={data.options.map((option) => (<OptionItem data={option} vixonicData={vixonicData} />))}
43
+ animate={true}
44
+ animation={{
45
+ mode: parameters.animationMode || 'fade',
46
+ duration: cycle
47
+ }}
48
+ layout={{
49
+ columns: 1,
50
+ rows,
51
+ alignment: {
52
+ h: 'start',
53
+ v: 'center'
54
+ }
55
+ }} />
56
+ }
57
+ </div>
58
+ }
59
+ }
Binary file
@@ -0,0 +1,37 @@
1
+ {
2
+ "parameters":{
3
+ "animationDuration":10,
4
+ "animationMode":"fade",
5
+ "backgroundImage":{
6
+ "filename":"background.jpg"
7
+ },
8
+ "containerGridMargins":"110px 30px 30px 30px",
9
+ "containerGridRows":2,
10
+ "containerGridRowsGap":5,
11
+ "itemGridRows":3,
12
+ "itemOptionsTextFormat":{
13
+ "alignment":{
14
+
15
+ },
16
+ "fontSize":14,
17
+ "font": {
18
+ "filename": "futura-font.ttf"
19
+ }
20
+ },
21
+ "itemStyle":"modern",
22
+ "itemTitleBackgroundColor": "#EA7D15",
23
+ "itemTitleTextFormat":{
24
+ "alignment":{
25
+
26
+ },
27
+ "fontColor":"#fff",
28
+ "fontSize":14,
29
+ "font": {
30
+ "filename": "bold-font.ttf"
31
+ }
32
+ },
33
+ "pollingInterval": 300000,
34
+ "url":"./static/menu-daily-example.xlsx",
35
+ "url2":"https://docs.google.com/spreadsheets/d/e/2PACX-1vRTuTsKdqpLH2zqKXURYTu_xpc5arXljE0W8KfnPJVy5U_J1HGD30C5YfVrWjUFAz5W9JiTC4VGVBYN/pub?output=xlsx"
36
+ }
37
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2015",
4
+ "module": "es2015",
5
+ "moduleResolution": "node",
6
+ "jsx": "preserve",
7
+ "allowJs": true,
8
+ "checkJs": true,
9
+ "allowSyntheticDefaultImports": true,
10
+ "emitDecoratorMetadata": true,
11
+ "experimentalDecorators": true,
12
+ "downlevelIteration": true,
13
+ "strict": true,
14
+ "forceConsistentCasingInFileNames": true,
15
+ "noFallthroughCasesInSwitch": true,
16
+ "noImplicitReturns": true,
17
+ "noImplicitAny": true,
18
+ "noImplicitThis": true,
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true,
21
+ "sourceMap": true,
22
+ "types": [
23
+ "node"
24
+ ],
25
+ "typeRoots": [
26
+ "./node_modules/@types",
27
+ "./src"
28
+ ]
29
+ },
30
+ "include": [
31
+ "./src/**/*"
32
+ ],
33
+ "exclude": [
34
+ "./node_modules/**/*"
35
+ ]
36
+ }
package/tslint.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": [
3
+ "tslint-config-standard"
4
+ ]
5
+ }