@onetype/framework 2.0.26 → 2.0.27

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 (65) hide show
  1. package/addons/core/assets/back/functions/utils/transform.js +1 -1
  2. package/addons/render/directives/front/js/functions/process/data.js +0 -1
  3. package/addons/render/transforms/addon.js +2 -0
  4. package/addons/render/transforms/functions/data.js +21 -0
  5. package/addons/render/transforms/functions/run.js +11 -0
  6. package/addons/render/transforms/item/functions/load.js +55 -0
  7. package/addons/render/transforms/item/functions/run.js +12 -0
  8. package/addons/render/transforms/items/directives/transform.js +15 -18
  9. package/lib/items/elements/global/heading/heading.css +1 -1
  10. package/lib/items/elements/global/markdown/markdown.js +207 -3
  11. package/lib/items/elements/{sections → navigation}/navbar/navbar.css +9 -9
  12. package/lib/items/elements/{sections → navigation}/navbar/navbar.js +2 -2
  13. package/lib/items/elements/navigation/sidebar/sidebar.css +101 -0
  14. package/lib/items/elements/navigation/sidebar/sidebar.js +56 -0
  15. package/lib/items/elements/{global → navigation}/tabs/tabs.css +6 -6
  16. package/lib/items/elements/{global → navigation}/tabs/tabs.js +2 -2
  17. package/lib/items/elements/sections/pricing/pricing.css +148 -0
  18. package/lib/items/elements/sections/pricing/pricing.js +76 -0
  19. package/lib/items/transforms/accordion/accordion.js +139 -141
  20. package/lib/items/transforms/chart/area.js +130 -133
  21. package/lib/items/transforms/chart/bar.js +116 -119
  22. package/lib/items/transforms/chart/bubble.js +142 -145
  23. package/lib/items/transforms/chart/doughnut.js +104 -107
  24. package/lib/items/transforms/chart/line.js +127 -130
  25. package/lib/items/transforms/chart/pie.js +102 -105
  26. package/lib/items/transforms/chart/radar.js +134 -137
  27. package/lib/items/transforms/chart/scatter.js +127 -130
  28. package/lib/items/transforms/codeflask/codeflask.js +10 -12
  29. package/lib/items/transforms/codemirror/codemirror.js +186 -189
  30. package/lib/items/transforms/comparison/comparison.js +130 -133
  31. package/lib/items/transforms/heatmap/heatmap.js +406 -407
  32. package/lib/items/transforms/interact/interact.js +240 -241
  33. package/lib/items/transforms/particles/particles.js +282 -283
  34. package/lib/items/transforms/sparkline/sparkline.js +207 -208
  35. package/lib/items/transforms/swiper/swiper.js +115 -118
  36. package/lib/items/transforms/tabs/tabs.js +383 -384
  37. package/lib/items/transforms/typed/typed.js +146 -147
  38. package/lib/load.js +8 -16
  39. package/lib/src/mixins/addons.js +10 -10
  40. package/lib/styles/variables.css +1 -1
  41. package/package.json +1 -1
  42. package/addons/render/transforms/functions/load/assets.js +0 -49
  43. /package/{addons/render/directives/front/js/items → lib/items/directives}/100-if.js +0 -0
  44. /package/{addons/render/directives/front/js/items → lib/items/directives}/1000-render.js +0 -0
  45. /package/{addons/render/directives/front/js/items → lib/items/directives}/110-show.js +0 -0
  46. /package/{addons/render/directives/front/js/items → lib/items/directives}/160-slot.js +0 -0
  47. /package/{addons/render/directives/front/js/items → lib/items/directives}/200-for.js +0 -0
  48. /package/{addons/render/directives/front/js/items → lib/items/directives}/500-blur.js +0 -0
  49. /package/{addons/render/directives/front/js/items → lib/items/directives}/500-change.js +0 -0
  50. /package/{addons/render/directives/front/js/items → lib/items/directives}/500-click-outside.js +0 -0
  51. /package/{addons/render/directives/front/js/items → lib/items/directives}/500-click.js +0 -0
  52. /package/{addons/render/directives/front/js/items → lib/items/directives}/500-double-click.js +0 -0
  53. /package/{addons/render/directives/front/js/items → lib/items/directives}/500-focus.js +0 -0
  54. /package/{addons/render/directives/front/js/items → lib/items/directives}/500-input.js +0 -0
  55. /package/{addons/render/directives/front/js/items → lib/items/directives}/500-keydown.js +0 -0
  56. /package/{addons/render/directives/front/js/items → lib/items/directives}/500-keyup.js +0 -0
  57. /package/{addons/render/directives/front/js/items → lib/items/directives}/500-mouse-enter.js +0 -0
  58. /package/{addons/render/directives/front/js/items → lib/items/directives}/500-mouse-leave.js +0 -0
  59. /package/{addons/render/directives/front/js/items → lib/items/directives}/500-mouse-move.js +0 -0
  60. /package/{addons/render/directives/front/js/items → lib/items/directives}/500-scroll.js +0 -0
  61. /package/{addons/render/directives/front/js/items → lib/items/directives}/500-submit.js +0 -0
  62. /package/{addons/render/directives/front/js/items → lib/items/directives}/650-fetch.js +0 -0
  63. /package/{addons/render/directives/front/js/items → lib/items/directives}/660-form.js +0 -0
  64. /package/{addons/render/directives/front/js/items → lib/items/directives}/700-text.js +0 -0
  65. /package/{addons/render/directives/front/js/items → lib/items/directives}/750-html.js +0 -0
@@ -1,156 +1,153 @@
1
- onetype.AddonReady('transforms', (transforms) =>
2
- {
3
- transforms.ItemAdd({
4
- id: 'ot-chart-area',
5
- icon: 'area_chart',
6
- name: 'Area Chart',
7
- description: 'Filled area chart visualization. Show data trends with colored regions under the line.',
8
- js: [
9
- 'https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js'
10
- ],
11
- config: {
12
- 'labels': ['array', ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']],
13
- 'datasets': ['array', []],
14
- 'stacked': ['boolean', false],
15
- 'smooth': ['boolean', true],
16
- 'options': ['object', {}]
17
- },
18
- code: function(data, item, compile, node, identifier)
1
+ transforms.ItemAdd({
2
+ id: 'ot-chart-area',
3
+ icon: 'area_chart',
4
+ name: 'Area Chart',
5
+ description: 'Filled area chart visualization. Show data trends with colored regions under the line.',
6
+ js: [
7
+ 'https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js'
8
+ ],
9
+ config: {
10
+ 'labels': ['array', ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']],
11
+ 'datasets': ['array', []],
12
+ 'stacked': ['boolean', false],
13
+ 'smooth': ['boolean', true],
14
+ 'options': ['object', {}]
15
+ },
16
+ code: function(data, node, transformer)
17
+ {
18
+ this.setup = () =>
19
19
  {
20
- this.setup = () =>
21
- {
22
- node.innerHTML = '';
23
- node.classList.add('ot-chart-area');
20
+ node.innerHTML = '';
21
+ node.classList.add('ot-chart-area');
24
22
 
25
- const canvas = document.createElement('canvas');
26
- this.canvas = canvas;
27
- node.appendChild(canvas);
28
- };
23
+ const canvas = document.createElement('canvas');
24
+ this.canvas = canvas;
25
+ node.appendChild(canvas);
26
+ };
29
27
 
30
- this.colors = () =>
31
- {
32
- const style = getComputedStyle(document.body);
28
+ this.colors = () =>
29
+ {
30
+ const style = getComputedStyle(document.body);
33
31
 
34
- return {
35
- brand: style.getPropertyValue('--ot-brand').trim(),
36
- blue: style.getPropertyValue('--ot-blue').trim(),
37
- green: style.getPropertyValue('--ot-green').trim(),
38
- orange: style.getPropertyValue('--ot-orange').trim(),
39
- red: style.getPropertyValue('--ot-red').trim(),
40
- brandOpacity: style.getPropertyValue('--ot-brand-opacity').trim(),
41
- blueOpacity: style.getPropertyValue('--ot-blue-opacity').trim(),
42
- greenOpacity: style.getPropertyValue('--ot-green-opacity').trim(),
43
- orangeOpacity: style.getPropertyValue('--ot-orange-opacity').trim(),
44
- redOpacity: style.getPropertyValue('--ot-red-opacity').trim()
45
- };
32
+ return {
33
+ brand: style.getPropertyValue('--ot-brand').trim(),
34
+ blue: style.getPropertyValue('--ot-blue').trim(),
35
+ green: style.getPropertyValue('--ot-green').trim(),
36
+ orange: style.getPropertyValue('--ot-orange').trim(),
37
+ red: style.getPropertyValue('--ot-red').trim(),
38
+ brandOpacity: style.getPropertyValue('--ot-brand-opacity').trim(),
39
+ blueOpacity: style.getPropertyValue('--ot-blue-opacity').trim(),
40
+ greenOpacity: style.getPropertyValue('--ot-green-opacity').trim(),
41
+ orangeOpacity: style.getPropertyValue('--ot-orange-opacity').trim(),
42
+ redOpacity: style.getPropertyValue('--ot-red-opacity').trim()
46
43
  };
44
+ };
47
45
 
48
- this.datasets = () =>
49
- {
50
- const datasets = data['datasets'].value;
51
- const colors = this.colors();
52
- const palette = [colors.brand, colors.blue, colors.green, colors.orange, colors.red];
53
- const paletteOpacity = [colors.brandOpacity, colors.blueOpacity, colors.greenOpacity, colors.orangeOpacity, colors.redOpacity];
54
- const smooth = data['smooth'].value;
55
-
56
- if(datasets.length === 0)
57
- {
58
- return [{
59
- label: 'Sample Data',
60
- data: [30, 45, 28, 56, 42, 65],
61
- backgroundColor: paletteOpacity[0],
62
- borderColor: palette[0],
63
- borderWidth: 2,
64
- fill: true,
65
- tension: smooth ? 0.4 : 0
66
- }];
67
- }
68
-
69
- return datasets.map((dataset, index) =>
70
- {
71
- const color = palette[index % palette.length];
72
- const colorOpacity = paletteOpacity[index % paletteOpacity.length];
46
+ this.datasets = () =>
47
+ {
48
+ const datasets = data['datasets'];
49
+ const colors = this.colors();
50
+ const palette = [colors.brand, colors.blue, colors.green, colors.orange, colors.red];
51
+ const paletteOpacity = [colors.brandOpacity, colors.blueOpacity, colors.greenOpacity, colors.orangeOpacity, colors.redOpacity];
52
+ const smooth = data['smooth'];
73
53
 
74
- return {
75
- ...dataset,
76
- backgroundColor: dataset.backgroundColor || colorOpacity,
77
- borderColor: dataset.borderColor || color,
78
- borderWidth: dataset.borderWidth || 2,
79
- fill: dataset.fill !== undefined ? dataset.fill : true,
80
- tension: dataset.tension !== undefined ? dataset.tension : (smooth ? 0.4 : 0)
81
- };
82
- });
83
- };
54
+ if(datasets.length === 0)
55
+ {
56
+ return [{
57
+ label: 'Sample Data',
58
+ data: [30, 45, 28, 56, 42, 65],
59
+ backgroundColor: paletteOpacity[0],
60
+ borderColor: palette[0],
61
+ borderWidth: 2,
62
+ fill: true,
63
+ tension: smooth ? 0.4 : 0
64
+ }];
65
+ }
84
66
 
85
- this.config = () =>
67
+ return datasets.map((dataset, index) =>
86
68
  {
87
- const style = getComputedStyle(document.body);
88
- const textColor = style.getPropertyValue('--ot-text-1').trim();
89
- const gridColor = style.getPropertyValue('--ot-bg-3-border').trim();
90
- const stacked = data['stacked'].value;
69
+ const color = palette[index % palette.length];
70
+ const colorOpacity = paletteOpacity[index % paletteOpacity.length];
91
71
 
92
72
  return {
93
- type: 'line',
94
- data: {
95
- labels: data['labels'].value,
96
- datasets: this.datasets()
73
+ ...dataset,
74
+ backgroundColor: dataset.backgroundColor || colorOpacity,
75
+ borderColor: dataset.borderColor || color,
76
+ borderWidth: dataset.borderWidth || 2,
77
+ fill: dataset.fill !== undefined ? dataset.fill : true,
78
+ tension: dataset.tension !== undefined ? dataset.tension : (smooth ? 0.4 : 0)
79
+ };
80
+ });
81
+ };
82
+
83
+ this.config = () =>
84
+ {
85
+ const style = getComputedStyle(document.body);
86
+ const textColor = style.getPropertyValue('--ot-text-1').trim();
87
+ const gridColor = style.getPropertyValue('--ot-bg-3-border').trim();
88
+ const stacked = data['stacked'];
89
+
90
+ return {
91
+ type: 'line',
92
+ data: {
93
+ labels: data['labels'],
94
+ datasets: this.datasets()
95
+ },
96
+ options: {
97
+ responsive: true,
98
+ maintainAspectRatio: false,
99
+ interaction: {
100
+ intersect: false,
101
+ mode: 'index'
97
102
  },
98
- options: {
99
- responsive: true,
100
- maintainAspectRatio: false,
101
- interaction: {
102
- intersect: false,
103
- mode: 'index'
104
- },
105
- plugins: {
106
- legend: {
107
- labels: {
108
- color: textColor,
109
- font: {
110
- family: style.getPropertyValue('--ot-font-primary').trim()
111
- }
103
+ plugins: {
104
+ legend: {
105
+ labels: {
106
+ color: textColor,
107
+ font: {
108
+ family: style.getPropertyValue('--ot-font-primary').trim()
112
109
  }
113
- },
114
- filler: {
115
- propagate: false
116
110
  }
117
111
  },
118
- scales: {
119
- x: {
120
- ticks: { color: textColor },
121
- grid: { color: gridColor }
122
- },
123
- y: {
124
- stacked: stacked,
125
- ticks: { color: textColor },
126
- grid: { color: gridColor },
127
- beginAtZero: true
128
- }
112
+ filler: {
113
+ propagate: false
114
+ }
115
+ },
116
+ scales: {
117
+ x: {
118
+ ticks: { color: textColor },
119
+ grid: { color: gridColor }
129
120
  },
130
- ...data['options'].value
131
- }
132
- };
121
+ y: {
122
+ stacked: stacked,
123
+ ticks: { color: textColor },
124
+ grid: { color: gridColor },
125
+ beginAtZero: true
126
+ }
127
+ },
128
+ ...data['options']
129
+ }
133
130
  };
131
+ };
134
132
 
135
- this.initialize = () =>
133
+ this.initialize = () =>
134
+ {
135
+ setTimeout(() =>
136
136
  {
137
- setTimeout(() =>
137
+ if(typeof Chart === 'undefined')
138
138
  {
139
- if(typeof Chart === 'undefined')
140
- {
141
- console.error('Chart.js library not loaded');
142
- return;
143
- }
139
+ console.error('Chart.js library not loaded');
140
+ return;
141
+ }
144
142
 
145
- const context = this.canvas.getContext('2d');
146
- this.instance = new Chart(context, this.config());
143
+ const context = this.canvas.getContext('2d');
144
+ this.instance = new Chart(context, this.config());
147
145
 
148
- node.chart = this.instance;
149
- }, 100);
150
- };
146
+ node.chart = this.instance;
147
+ }, 100);
148
+ };
151
149
 
152
- this.setup();
153
- this.initialize();
154
- }
155
- });
156
- });
150
+ this.setup();
151
+ this.initialize();
152
+ }
153
+ });
@@ -1,140 +1,137 @@
1
- onetype.AddonReady('transforms', (transforms) =>
2
- {
3
- transforms.ItemAdd({
4
- id: 'ot-chart-bar',
5
- icon: 'bar_chart',
6
- name: 'Bar Chart',
7
- description: 'Vertical or horizontal bar charts. Compare values across categories with bars.',
8
- js: [
9
- 'https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js'
10
- ],
11
- config: {
12
- 'labels': ['array', ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']],
13
- 'datasets': ['array', []],
14
- 'stacked': ['boolean', false],
15
- 'horizontal': ['boolean', false],
16
- 'options': ['object', {}]
17
- },
18
- code: function(data, item, compile, node, identifier)
1
+ transforms.ItemAdd({
2
+ id: 'ot-chart-bar',
3
+ icon: 'bar_chart',
4
+ name: 'Bar Chart',
5
+ description: 'Vertical or horizontal bar charts. Compare values across categories with bars.',
6
+ js: [
7
+ 'https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js'
8
+ ],
9
+ config: {
10
+ 'labels': ['array', ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']],
11
+ 'datasets': ['array', []],
12
+ 'stacked': ['boolean', false],
13
+ 'horizontal': ['boolean', false],
14
+ 'options': ['object', {}]
15
+ },
16
+ code: function(data, node, transformer)
17
+ {
18
+ this.setup = () =>
19
19
  {
20
- this.setup = () =>
21
- {
22
- node.innerHTML = '';
23
- node.classList.add('ot-chart-bar');
20
+ node.innerHTML = '';
21
+ node.classList.add('ot-chart-bar');
24
22
 
25
- const canvas = document.createElement('canvas');
26
- this.canvas = canvas;
27
- node.appendChild(canvas);
28
- };
23
+ const canvas = document.createElement('canvas');
24
+ this.canvas = canvas;
25
+ node.appendChild(canvas);
26
+ };
29
27
 
30
- this.colors = () =>
31
- {
32
- const style = getComputedStyle(document.body);
28
+ this.colors = () =>
29
+ {
30
+ const style = getComputedStyle(document.body);
33
31
 
34
- return {
35
- brand: style.getPropertyValue('--ot-brand').trim(),
36
- blue: style.getPropertyValue('--ot-blue').trim(),
37
- green: style.getPropertyValue('--ot-green').trim(),
38
- orange: style.getPropertyValue('--ot-orange').trim(),
39
- red: style.getPropertyValue('--ot-red').trim()
40
- };
32
+ return {
33
+ brand: style.getPropertyValue('--ot-brand').trim(),
34
+ blue: style.getPropertyValue('--ot-blue').trim(),
35
+ green: style.getPropertyValue('--ot-green').trim(),
36
+ orange: style.getPropertyValue('--ot-orange').trim(),
37
+ red: style.getPropertyValue('--ot-red').trim()
41
38
  };
39
+ };
42
40
 
43
- this.datasets = () =>
44
- {
45
- const datasets = data['datasets'].value;
46
- const colors = this.colors();
47
- const palette = [colors.brand, colors.blue, colors.green, colors.orange, colors.red];
48
-
49
- if(datasets.length === 0)
50
- {
51
- return [{
52
- label: 'Sample Data',
53
- data: [42, 56, 28, 84, 65, 39],
54
- backgroundColor: palette[0],
55
- borderColor: palette[0],
56
- borderWidth: 0
57
- }];
58
- }
59
-
60
- return datasets.map((dataset, index) =>
61
- {
62
- const color = palette[index % palette.length];
41
+ this.datasets = () =>
42
+ {
43
+ const datasets = data['datasets'];
44
+ const colors = this.colors();
45
+ const palette = [colors.brand, colors.blue, colors.green, colors.orange, colors.red];
63
46
 
64
- return {
65
- ...dataset,
66
- backgroundColor: dataset.backgroundColor || color,
67
- borderColor: dataset.borderColor || color,
68
- borderWidth: dataset.borderWidth || 0
69
- };
70
- });
71
- };
47
+ if(datasets.length === 0)
48
+ {
49
+ return [{
50
+ label: 'Sample Data',
51
+ data: [42, 56, 28, 84, 65, 39],
52
+ backgroundColor: palette[0],
53
+ borderColor: palette[0],
54
+ borderWidth: 0
55
+ }];
56
+ }
72
57
 
73
- this.config = () =>
58
+ return datasets.map((dataset, index) =>
74
59
  {
75
- const style = getComputedStyle(document.body);
76
- const textColor = style.getPropertyValue('--ot-text-1').trim();
77
- const gridColor = style.getPropertyValue('--ot-bg-3-border').trim();
78
- const stacked = data['stacked'].value;
79
- const horizontal = data['horizontal'].value;
60
+ const color = palette[index % palette.length];
80
61
 
81
62
  return {
82
- type: horizontal ? 'bar' : 'bar',
83
- data: {
84
- labels: data['labels'].value,
85
- datasets: this.datasets()
86
- },
87
- options: {
88
- indexAxis: horizontal ? 'y' : 'x',
89
- responsive: true,
90
- maintainAspectRatio: false,
91
- plugins: {
92
- legend: {
93
- labels: {
94
- color: textColor,
95
- font: {
96
- family: style.getPropertyValue('--ot-font-primary').trim()
97
- }
63
+ ...dataset,
64
+ backgroundColor: dataset.backgroundColor || color,
65
+ borderColor: dataset.borderColor || color,
66
+ borderWidth: dataset.borderWidth || 0
67
+ };
68
+ });
69
+ };
70
+
71
+ this.config = () =>
72
+ {
73
+ const style = getComputedStyle(document.body);
74
+ const textColor = style.getPropertyValue('--ot-text-1').trim();
75
+ const gridColor = style.getPropertyValue('--ot-bg-3-border').trim();
76
+ const stacked = data['stacked'];
77
+ const horizontal = data['horizontal'];
78
+
79
+ return {
80
+ type: horizontal ? 'bar' : 'bar',
81
+ data: {
82
+ labels: data['labels'],
83
+ datasets: this.datasets()
84
+ },
85
+ options: {
86
+ indexAxis: horizontal ? 'y' : 'x',
87
+ responsive: true,
88
+ maintainAspectRatio: false,
89
+ plugins: {
90
+ legend: {
91
+ labels: {
92
+ color: textColor,
93
+ font: {
94
+ family: style.getPropertyValue('--ot-font-primary').trim()
98
95
  }
99
96
  }
97
+ }
98
+ },
99
+ scales: {
100
+ x: {
101
+ stacked: stacked,
102
+ ticks: { color: textColor },
103
+ grid: { color: gridColor }
100
104
  },
101
- scales: {
102
- x: {
103
- stacked: stacked,
104
- ticks: { color: textColor },
105
- grid: { color: gridColor }
106
- },
107
- y: {
108
- stacked: stacked,
109
- ticks: { color: textColor },
110
- grid: { color: gridColor },
111
- beginAtZero: true
112
- }
113
- },
114
- ...data['options'].value
115
- }
116
- };
105
+ y: {
106
+ stacked: stacked,
107
+ ticks: { color: textColor },
108
+ grid: { color: gridColor },
109
+ beginAtZero: true
110
+ }
111
+ },
112
+ ...data['options']
113
+ }
117
114
  };
115
+ };
118
116
 
119
- this.initialize = () =>
117
+ this.initialize = () =>
118
+ {
119
+ setTimeout(() =>
120
120
  {
121
- setTimeout(() =>
121
+ if(typeof Chart === 'undefined')
122
122
  {
123
- if(typeof Chart === 'undefined')
124
- {
125
- console.error('Chart.js library not loaded');
126
- return;
127
- }
123
+ console.error('Chart.js library not loaded');
124
+ return;
125
+ }
128
126
 
129
- const context = this.canvas.getContext('2d');
130
- this.instance = new Chart(context, this.config());
127
+ const context = this.canvas.getContext('2d');
128
+ this.instance = new Chart(context, this.config());
131
129
 
132
- node.chart = this.instance;
133
- }, 100);
134
- };
130
+ node.chart = this.instance;
131
+ }, 100);
132
+ };
135
133
 
136
- this.setup();
137
- this.initialize();
138
- }
139
- });
140
- });
134
+ this.setup();
135
+ this.initialize();
136
+ }
137
+ });