@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,9 +1,9 @@
1
- .e-4a1d3792
1
+ .e-1a8b6ac1
2
2
  {
3
3
  display: flex;
4
4
  }
5
5
 
6
- .e-4a1d3792 > .holder
6
+ .e-1a8b6ac1 > .holder
7
7
  {
8
8
  display: flex;
9
9
  align-items: center;
@@ -14,7 +14,7 @@
14
14
  padding: 4px;
15
15
  }
16
16
 
17
- .e-4a1d3792 > .holder > .tab
17
+ .e-1a8b6ac1 > .holder > .tab
18
18
  {
19
19
  display: flex;
20
20
  align-items: center;
@@ -30,18 +30,18 @@
30
30
  transition: all 0.2s ease;
31
31
  }
32
32
 
33
- .e-4a1d3792 > .holder > .tab > i
33
+ .e-1a8b6ac1 > .holder > .tab > i
34
34
  {
35
35
  font-size: 16px;
36
36
  }
37
37
 
38
- .e-4a1d3792 > .holder > .tab.active
38
+ .e-1a8b6ac1 > .holder > .tab.active
39
39
  {
40
40
  background: var(--ot-bg-3);
41
41
  color: var(--ot-text-1);
42
42
  }
43
43
 
44
- .e-4a1d3792 > .holder > .tab:hover:not(.active)
44
+ .e-1a8b6ac1 > .holder > .tab:hover:not(.active)
45
45
  {
46
46
  color: var(--ot-text-1);
47
47
  }
@@ -1,11 +1,11 @@
1
1
  onetype.AddonReady('elements', (elements) =>
2
2
  {
3
3
  elements.ItemAdd({
4
- id: 'global-tabs',
4
+ id: 'navigation-tabs',
5
5
  icon: 'tab',
6
6
  name: 'Tabs',
7
7
  description: 'Pill-style tab switcher with optional icons.',
8
- category: 'Global',
8
+ category: 'Navigation',
9
9
  author: 'OneType',
10
10
  config: {
11
11
  active: {
@@ -0,0 +1,148 @@
1
+ .e-21efbac3
2
+ {
3
+ display: flex;
4
+ width: 100%;
5
+ }
6
+
7
+ .e-21efbac3 > .holder
8
+ {
9
+ display: flex;
10
+ flex-direction: column;
11
+ width: 100%;
12
+ padding: var(--ot-spacing-l) var(--ot-spacing-m);
13
+ gap: var(--ot-spacing-l);
14
+ }
15
+
16
+ .e-21efbac3 > .holder.highlighted
17
+ {
18
+ border-top: 2px solid var(--ot-brand);
19
+ }
20
+
21
+ /* Header */
22
+
23
+ .e-21efbac3 > .holder > .header
24
+ {
25
+ display: flex;
26
+ flex-direction: column;
27
+ gap: var(--ot-spacing-s);
28
+ }
29
+
30
+ .e-21efbac3 > .holder > .header > .badge
31
+ {
32
+ display: inline-flex;
33
+ align-self: flex-start;
34
+ padding: 3px 10px;
35
+ border-radius: 100px;
36
+ background: color-mix(in srgb, var(--ot-brand) 12%, transparent);
37
+ font-size: 11px;
38
+ font-weight: 600;
39
+ color: var(--ot-brand);
40
+ text-transform: uppercase;
41
+ letter-spacing: 0.5px;
42
+ }
43
+
44
+ .e-21efbac3 > .holder > .header > .name
45
+ {
46
+ font-size: 20px;
47
+ font-weight: 700;
48
+ color: var(--ot-text-1);
49
+ margin: 0;
50
+ }
51
+
52
+ .e-21efbac3 > .holder > .header > .description
53
+ {
54
+ font-size: var(--ot-size-s);
55
+ color: var(--ot-text-2);
56
+ line-height: 1.5;
57
+ margin: 0;
58
+ }
59
+
60
+ .e-21efbac3 > .holder > .header > .price
61
+ {
62
+ display: flex;
63
+ align-items: baseline;
64
+ gap: 2px;
65
+ margin-top: var(--ot-spacing-x);
66
+ }
67
+
68
+ .e-21efbac3 > .holder > .header > .price > .currency
69
+ {
70
+ font-size: 20px;
71
+ font-weight: 700;
72
+ color: var(--ot-text-1);
73
+ }
74
+
75
+ .e-21efbac3 > .holder > .header > .price > .amount
76
+ {
77
+ font-size: 40px;
78
+ font-weight: 800;
79
+ color: var(--ot-text-1);
80
+ line-height: 1;
81
+ }
82
+
83
+ .e-21efbac3 > .holder > .header > .price > .period
84
+ {
85
+ font-size: var(--ot-size-m);
86
+ color: var(--ot-text-2);
87
+ margin-left: 4px;
88
+ }
89
+
90
+ .e-21efbac3 > .holder > .header > .yearly
91
+ {
92
+ font-size: var(--ot-size-s);
93
+ color: var(--ot-text-2);
94
+ }
95
+
96
+ /* Features */
97
+
98
+ .e-21efbac3 > .holder > .features
99
+ {
100
+ display: flex;
101
+ flex-direction: column;
102
+ gap: var(--ot-spacing-s);
103
+ flex: 1;
104
+ padding-top: var(--ot-spacing-l);
105
+ border-top: 1px solid var(--ot-bg-2-border);
106
+ }
107
+
108
+ .e-21efbac3 > .holder > .features > .feature
109
+ {
110
+ display: flex;
111
+ align-items: center;
112
+ gap: var(--ot-spacing-s);
113
+ }
114
+
115
+ .e-21efbac3 > .holder > .features > .feature > .icon
116
+ {
117
+ font-size: 18px;
118
+ flex-shrink: 0;
119
+ color: var(--ot-green);
120
+ }
121
+
122
+ .e-21efbac3 > .holder > .features > .feature > .text
123
+ {
124
+ font-size: var(--ot-size-m);
125
+ color: var(--ot-text-2);
126
+ }
127
+
128
+ /* Disabled */
129
+
130
+ .e-21efbac3 > .holder > .features > .feature.disabled > .icon
131
+ {
132
+ color: var(--ot-text-2);
133
+ opacity: 0.4;
134
+ }
135
+
136
+ .e-21efbac3 > .holder > .features > .feature.disabled > .text
137
+ {
138
+ color: var(--ot-text-2);
139
+ opacity: 0.4;
140
+ }
141
+
142
+ /* Action */
143
+
144
+ .e-21efbac3 > .holder > .action
145
+ {
146
+ display: flex;
147
+ margin-top: auto;
148
+ }
@@ -0,0 +1,76 @@
1
+ onetype.AddonReady('elements', (elements) =>
2
+ {
3
+ elements.ItemAdd({
4
+ id: 'sections-pricing',
5
+ icon: 'payments',
6
+ name: 'Pricing Card',
7
+ description: 'Pricing plan card with name, price, features list, and CTA button.',
8
+ category: 'Section',
9
+ author: 'OneType',
10
+ config: {
11
+ name: {
12
+ type: 'string',
13
+ value: 'Plan'
14
+ },
15
+ price: {
16
+ type: 'number',
17
+ value: 0
18
+ },
19
+ period: {
20
+ type: 'string',
21
+ value: '/mo'
22
+ },
23
+ yearly: {
24
+ type: 'string',
25
+ value: ''
26
+ },
27
+ badge: {
28
+ type: 'string',
29
+ value: ''
30
+ },
31
+ description: {
32
+ type: 'string',
33
+ value: ''
34
+ },
35
+ features: {
36
+ type: 'array',
37
+ value: []
38
+ },
39
+ highlighted: {
40
+ type: 'boolean',
41
+ value: false
42
+ },
43
+ href: {
44
+ type: 'string',
45
+ value: ''
46
+ }
47
+ },
48
+ render: function()
49
+ {
50
+ return `
51
+ <div :class="'holder' + (highlighted ? ' highlighted' : '')">
52
+ <div class="header">
53
+ <span ot-if="badge" class="badge">{{ badge }}</span>
54
+ <h3 class="name">{{ name }}</h3>
55
+ <p ot-if="description" class="description">{{ description }}</p>
56
+ <div class="price">
57
+ <span class="currency">$</span>
58
+ <span class="amount">{{ price }}</span>
59
+ <span class="period">{{ period }}</span>
60
+ </div>
61
+ <span ot-if="yearly" class="yearly">{{ yearly }}</span>
62
+ </div>
63
+ <div class="features">
64
+ <div ot-for="feature in features" :class="'feature' + (feature.included ? '' : ' disabled')">
65
+ <i class="icon">{{ feature.included ? 'check_circle' : 'remove' }}</i>
66
+ <span class="text">{{ feature.text }}</span>
67
+ </div>
68
+ </div>
69
+ <div class="action">
70
+ <e-form-button text="Get Started" icon="arrow_forward" :href="href" :variant="highlighted ? ['brand', 'size-m', 'full'] : ['bg-2', 'border', 'size-m', 'full']"></e-form-button>
71
+ </div>
72
+ </div>
73
+ `;
74
+ }
75
+ });
76
+ });
@@ -1,174 +1,172 @@
1
- onetype.AddonReady('transforms', (transforms) =>
2
- {
3
- transforms.ItemAdd({
4
- id: 'accordion',
5
- icon: 'expand_more',
6
- name: 'Accordion',
7
- description: 'Collapsible accordion component with multiple items. Supports single or multiple open panels with smooth animations.',
8
- config: {
9
- 'multiple': ['boolean', false],
10
- 'first-open': ['boolean', true],
11
- 'animation-duration': ['number', 300],
12
- 'icon': ['boolean', true],
13
- 'icon-position': ['string', 'right']
14
- },
15
- code: function(data, item, compile, node, identifier)
1
+ transforms.ItemAdd({
2
+ id: 'accordion',
3
+ icon: 'expand_more',
4
+ name: 'Accordion',
5
+ description: 'Collapsible accordion component with multiple items. Supports single or multiple open panels with smooth animations.',
6
+ config: {
7
+ 'multiple': ['boolean', false],
8
+ 'first-open': ['boolean', true],
9
+ 'animation-duration': ['number', 300],
10
+ 'icon': ['boolean', true],
11
+ 'icon-position': ['string', 'right']
12
+ },
13
+ code: function(data, node, transformer)
14
+ {
15
+ const id = 'accordion-' + onetype.Generate(8);
16
+
17
+ this.setup = () =>
16
18
  {
17
- this.setup = () =>
18
- {
19
- node.classList.add('accordion');
20
- node.classList.add('accordion-' + identifier);
19
+ node.classList.add('accordion');
20
+ node.classList.add(id);
21
+
22
+ const children = Array.from(node.children);
23
+ const items = [];
21
24
 
22
- const children = Array.from(node.children);
23
- const items = [];
25
+ for(let i = 0; i < children.length; i += 2)
26
+ {
27
+ const header = children[i];
28
+ const content = children[i + 1];
24
29
 
25
- for(let i = 0; i < children.length; i += 2)
30
+ if(!header || !content)
26
31
  {
27
- const header = children[i];
28
- const content = children[i + 1];
32
+ continue;
33
+ }
29
34
 
30
- if(!header || !content)
31
- {
32
- continue;
33
- }
35
+ const wrapper = document.createElement('div');
36
+ const headerWrapper = document.createElement('div');
37
+ const contentWrapper = document.createElement('div');
34
38
 
35
- const wrapper = document.createElement('div');
36
- const headerWrapper = document.createElement('div');
37
- const contentWrapper = document.createElement('div');
39
+ wrapper.className = 'accordion-item';
40
+ headerWrapper.className = 'accordion-header';
41
+ contentWrapper.className = 'accordion-content';
38
42
 
39
- wrapper.className = 'accordion-item';
40
- headerWrapper.className = 'accordion-header';
41
- contentWrapper.className = 'accordion-content';
43
+ headerWrapper.appendChild(header);
44
+ contentWrapper.appendChild(content);
42
45
 
43
- headerWrapper.appendChild(header);
44
- contentWrapper.appendChild(content);
46
+ wrapper.appendChild(headerWrapper);
47
+ wrapper.appendChild(contentWrapper);
45
48
 
46
- wrapper.appendChild(headerWrapper);
47
- wrapper.appendChild(contentWrapper);
49
+ items.push(wrapper);
50
+ }
48
51
 
49
- items.push(wrapper);
50
- }
52
+ node.innerHTML = '';
53
+ items.forEach(item => node.appendChild(item));
54
+ };
51
55
 
52
- node.innerHTML = '';
53
- items.forEach(item => node.appendChild(item));
54
- };
56
+ this.icons = () =>
57
+ {
58
+ if(!data['icon'])
59
+ {
60
+ return;
61
+ }
62
+
63
+ const headers = node.querySelectorAll('.accordion-header');
55
64
 
56
- this.icons = () =>
65
+ headers.forEach(header =>
57
66
  {
58
- if(!data['icon'].value)
67
+ const icon = document.createElement('span');
68
+ icon.className = 'accordion-icon';
69
+ icon.innerHTML = '▼';
70
+
71
+ if(data['icon-position'] === 'left')
59
72
  {
60
- return;
73
+ header.insertBefore(icon, header.firstChild);
61
74
  }
75
+ else
76
+ {
77
+ header.appendChild(icon);
78
+ }
79
+ });
80
+ };
81
+
82
+ this.styles = () =>
83
+ {
84
+ const duration = data['animation-duration'];
85
+ const style = document.createElement('style');
86
+
87
+ style.textContent = `
88
+ .${id} .accordion-content {
89
+ max-height: 0;
90
+ overflow: hidden;
91
+ transition: max-height ${duration}ms ease-in-out;
92
+ }
93
+ .${id} .accordion-item.active .accordion-content {
94
+ max-height: 2000px;
95
+ }
96
+ .${id} .accordion-header {
97
+ cursor: pointer;
98
+ display: flex;
99
+ justify-content: space-between;
100
+ align-items: center;
101
+ }
102
+ .${id} .accordion-icon {
103
+ transition: transform ${duration}ms ease;
104
+ display: inline-block;
105
+ }
106
+ .${id} .accordion-item.active .accordion-icon {
107
+ transform: rotate(180deg);
108
+ }
109
+ `;
62
110
 
63
- const headers = node.querySelectorAll('.accordion-header');
111
+ document.head.appendChild(style);
112
+ };
64
113
 
65
- headers.forEach(header =>
66
- {
67
- const icon = document.createElement('span');
68
- icon.className = 'accordion-icon';
69
- icon.innerHTML = '▼';
114
+ this.toggle = (item) =>
115
+ {
116
+ const isActive = item.classList.contains('active');
70
117
 
71
- if(data['icon-position'].value === 'left')
72
- {
73
- header.insertBefore(icon, header.firstChild);
74
- }
75
- else
118
+ if(!data['multiple'])
119
+ {
120
+ const items = node.querySelectorAll('.accordion-item');
121
+ items.forEach(otherItem =>
122
+ {
123
+ if(otherItem !== item)
76
124
  {
77
- header.appendChild(icon);
125
+ otherItem.classList.remove('active');
78
126
  }
79
127
  });
80
- };
128
+ }
81
129
 
82
- this.styles = () =>
130
+ if(isActive)
83
131
  {
84
- const duration = data['animation-duration'].value;
85
- const style = document.createElement('style');
86
-
87
- style.textContent = `
88
- .accordion-${identifier} .accordion-content {
89
- max-height: 0;
90
- overflow: hidden;
91
- transition: max-height ${duration}ms ease-in-out;
92
- }
93
- .accordion-${identifier} .accordion-item.active .accordion-content {
94
- max-height: 2000px;
95
- }
96
- .accordion-${identifier} .accordion-header {
97
- cursor: pointer;
98
- display: flex;
99
- justify-content: space-between;
100
- align-items: center;
101
- }
102
- .accordion-${identifier} .accordion-icon {
103
- transition: transform ${duration}ms ease;
104
- display: inline-block;
105
- }
106
- .accordion-${identifier} .accordion-item.active .accordion-icon {
107
- transform: rotate(180deg);
108
- }
109
- `;
110
-
111
- document.head.appendChild(style);
112
- };
113
-
114
- this.toggle = (item) =>
132
+ item.classList.remove('active');
133
+ }
134
+ else
115
135
  {
116
- const isActive = item.classList.contains('active');
117
- const content = item.querySelector('.accordion-content');
118
-
119
- if(!data['multiple'].value)
120
- {
121
- const items = node.querySelectorAll('.accordion-item');
122
- items.forEach(otherItem =>
123
- {
124
- if(otherItem !== item)
125
- {
126
- otherItem.classList.remove('active');
127
- }
128
- });
129
- }
136
+ item.classList.add('active');
137
+ }
138
+ };
130
139
 
131
- if(isActive)
132
- {
133
- item.classList.remove('active');
134
- }
135
- else
136
- {
137
- item.classList.add('active');
138
- }
139
- };
140
+ this.events = () =>
141
+ {
142
+ const headers = node.querySelectorAll('.accordion-header');
140
143
 
141
- this.events = () =>
144
+ headers.forEach(header =>
142
145
  {
143
- const headers = node.querySelectorAll('.accordion-header');
144
-
145
- headers.forEach(header =>
146
+ header.addEventListener('click', () =>
146
147
  {
147
- header.addEventListener('click', () =>
148
- {
149
- const item = header.parentElement;
150
- this.toggle(item);
151
- });
148
+ const item = header.parentElement;
149
+ this.toggle(item);
152
150
  });
153
- };
151
+ });
152
+ };
154
153
 
155
- this.initialize = () =>
154
+ this.initialize = () =>
155
+ {
156
+ if(data['first-open'])
156
157
  {
157
- if(data['first-open'].value)
158
+ const firstItem = node.querySelector('.accordion-item');
159
+ if(firstItem)
158
160
  {
159
- const firstItem = node.querySelector('.accordion-item');
160
- if(firstItem)
161
- {
162
- firstItem.classList.add('active');
163
- }
161
+ firstItem.classList.add('active');
164
162
  }
165
- };
166
-
167
- this.setup();
168
- this.icons();
169
- this.styles();
170
- this.events();
171
- this.initialize();
172
- }
173
- });
174
- });
163
+ }
164
+ };
165
+
166
+ this.setup();
167
+ this.icons();
168
+ this.styles();
169
+ this.events();
170
+ this.initialize();
171
+ }
172
+ });