@onetype/framework 2.0.30 → 2.0.32

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.
@@ -7,6 +7,6 @@ html.Item({
7
7
  priority: -60,
8
8
  attributes: {
9
9
  rel: 'icon',
10
- href: '/favicon.png'
10
+ href: 'https://cdn.onetype.ai/brand/logo/icon-orange.svg'
11
11
  }
12
12
  });
@@ -15,3 +15,8 @@
15
15
  position: relative;
16
16
  overflow: auto;
17
17
  }
18
+
19
+ .ot-page-area > div
20
+ {
21
+ height: 100%;
22
+ }
@@ -0,0 +1,64 @@
1
+ transforms.Fn('runtime', function()
2
+ {
3
+ this.methods.process = (node) =>
4
+ {
5
+ const id = node.getAttribute('ot');
6
+
7
+ if(!id)
8
+ {
9
+ return;
10
+ }
11
+
12
+ node.removeAttribute('ot');
13
+ transforms.Fn('run', id, node);
14
+ };
15
+
16
+ this.methods.scan = () =>
17
+ {
18
+ document.querySelectorAll('[ot]').forEach(node =>
19
+ {
20
+ this.methods.process(node);
21
+ });
22
+ };
23
+
24
+ this.methods.observe = () =>
25
+ {
26
+ new MutationObserver((mutations) =>
27
+ {
28
+ for(const mutation of mutations)
29
+ {
30
+ for(const node of mutation.addedNodes)
31
+ {
32
+ if(node.nodeType !== 1)
33
+ {
34
+ continue;
35
+ }
36
+
37
+ if(node.hasAttribute('ot'))
38
+ {
39
+ this.methods.process(node);
40
+ }
41
+
42
+ node.querySelectorAll('[ot]').forEach(child =>
43
+ {
44
+ this.methods.process(child);
45
+ });
46
+ }
47
+ }
48
+ }).observe(document.body, { childList: true, subtree: true });
49
+ };
50
+
51
+ if(document.readyState === 'loading')
52
+ {
53
+ document.addEventListener('DOMContentLoaded', () =>
54
+ {
55
+ this.methods.scan();
56
+ this.methods.observe();
57
+ });
58
+ }
59
+ else
60
+ {
61
+ this.methods.scan();
62
+ this.methods.observe();
63
+ }
64
+ });
@@ -61,6 +61,6 @@
61
61
  line-height: 1.6;
62
62
  background: var(--ot-bg-2);
63
63
  overflow-x: auto;
64
- white-space: pre;
64
+ white-space: break-spaces;
65
65
  tab-size: 4;
66
66
  }
@@ -12,6 +12,14 @@
12
12
  width: 100%;
13
13
  }
14
14
 
15
+ .e-4696d703 > .holder[variant="bg-2"]
16
+ {
17
+ background: var(--ot-bg-2);
18
+ border: 1px solid var(--ot-bg-2-border);
19
+ border-radius: var(--ot-radius-m);
20
+ padding: var(--ot-spacing-m);
21
+ }
22
+
15
23
  /* Line wrapper */
16
24
 
17
25
  .e-4696d703 > .holder > .line:empty
@@ -217,11 +217,16 @@ onetype.AddonReady('elements', (elements) =>
217
217
  content: {
218
218
  type: 'string',
219
219
  value: ''
220
+ },
221
+ variant: {
222
+ type: 'string',
223
+ value: '',
224
+ options: ['', 'bg-2']
220
225
  }
221
226
  },
222
227
  render: function()
223
228
  {
224
- return `<div class="holder">${parse(this.content)}</div>`;
229
+ return `<div class="holder" :variant="variant">${parse(this.content)}</div>`;
225
230
  }
226
231
  });
227
232
  });
@@ -11,6 +11,14 @@
11
11
  width: 100%;
12
12
  }
13
13
 
14
+ .e-29179902 > .holder[variant="bg-2"]
15
+ {
16
+ background: var(--ot-bg-2);
17
+ border: 1px solid var(--ot-bg-2-border);
18
+ border-radius: var(--ot-radius-m);
19
+ padding: var(--ot-spacing-m);
20
+ }
21
+
14
22
  .e-29179902 > .holder > .param
15
23
  {
16
24
  display: flex;
@@ -11,12 +11,17 @@ onetype.AddonReady('elements', (elements) =>
11
11
  items: {
12
12
  type: 'array',
13
13
  value: []
14
+ },
15
+ variant: {
16
+ type: 'string',
17
+ value: '',
18
+ options: ['', 'bg-2']
14
19
  }
15
20
  },
16
21
  render: function()
17
22
  {
18
23
  return `
19
- <div class="holder">
24
+ <div class="holder" :variant="variant">
20
25
  <div ot-for="item in items" class="param">
21
26
  <div class="left">
22
27
  <span class="name">{{ item.name }}</span>
@@ -20,9 +20,7 @@
20
20
  {
21
21
  display: flex;
22
22
  align-items: center;
23
- gap: var(--ot-spacing-s);
24
23
  text-decoration: none;
25
- color: var(--ot-text-1);
26
24
  flex-shrink: 0;
27
25
  }
28
26
 
@@ -31,6 +29,13 @@
31
29
  height: 16px;
32
30
  }
33
31
 
32
+ .e-64d8716d > .holder > .logo > .logo-arrow
33
+ {
34
+ display: none;
35
+ font-size: 16px;
36
+ color: var(--ot-text-2);
37
+ }
38
+
34
39
 
35
40
  /* Tabs */
36
41
 
@@ -38,8 +43,8 @@
38
43
  {
39
44
  display: flex;
40
45
  align-items: center;
41
- gap: var(--ot-spacing-x);
42
- margin-left: var(--ot-spacing-l);
46
+ margin-left: var(--ot-spacing-m);
47
+ border-left: 1px solid var(--ot-bg-2-border);
43
48
  height: 100%;
44
49
  }
45
50
 
@@ -49,7 +54,8 @@
49
54
  align-items: center;
50
55
  height: 100%;
51
56
  gap: 6px;
52
- padding: 0 var(--ot-spacing-s);
57
+ padding: 0 var(--ot-spacing-m);
58
+ border-right: 1px solid var(--ot-bg-2-border);
53
59
  text-decoration: none;
54
60
  white-space: nowrap;
55
61
  transition: color 0.2s ease, background 0.2s ease;
@@ -75,7 +81,7 @@
75
81
  {
76
82
  display: flex;
77
83
  align-items: center;
78
- gap: var(--ot-spacing-s);
79
84
  margin-left: auto;
85
+ border-left: 1px solid var(--ot-bg-2-border);
80
86
  height: 100%;
81
87
  }
@@ -47,13 +47,14 @@ onetype.AddonReady('elements', (elements) =>
47
47
  return `
48
48
  <nav class="holder">
49
49
  <a class="logo" href="/">
50
- <img class="logo-icon" src="https://global.divhunt.com/bd8ffd2fc9cf3a7e81b3326ac63a7cfe_4406.svg" alt="OneType" />
50
+ <img class="logo-icon" src="https://cdn.onetype.ai/brand/logo/full-orange.svg" alt="OneType" />
51
+ <i class="logo-arrow">keyboard_arrow_down</i>
51
52
  </a>
52
53
  <div class="tabs">
53
- <a ot-for="item in left" :class="'tab' + (item.active ? ' active' : '')" :href="item.href"><i>{{ item.icon }}</i> {{ item.label }}</a>
54
+ <a ot-for="item in left" :class="'tab' + (item.active ? ' active' : '')" :href="item.href" :target="item.target || null"><i>{{ item.icon }}</i> {{ item.label }}</a>
54
55
  </div>
55
56
  <div class="right">
56
- <a ot-for="item in right" :class="'tab' + (item.active ? ' active' : '')" :href="item.href"><i>{{ item.icon }}</i> {{ item.label }}</a>
57
+ <a ot-for="item in right" :class="'tab' + (item.active ? ' active' : '')" :href="item.href" :target="item.target || null"><i>{{ item.icon }}</i> {{ item.label }}</a>
57
58
  </div>
58
59
  </nav>
59
60
  `;
@@ -3,7 +3,7 @@
3
3
  display: flex;
4
4
  width: 240px;
5
5
  flex-shrink: 0;
6
- height: calc(100vh - 48px);
6
+ height: 100%;
7
7
  }
8
8
 
9
9
  .e-210c16c7 > .holder
@@ -15,13 +15,26 @@ onetype.AddonReady('elements', (elements) =>
15
15
  items: {
16
16
  type: 'array',
17
17
  value: []
18
+ },
19
+ _change: {
20
+ type: 'function'
18
21
  }
19
22
  },
20
23
  render: function()
21
24
  {
25
+ this.select = (id) =>
26
+ {
27
+ this.active = id;
28
+
29
+ if(this._change)
30
+ {
31
+ this._change(id);
32
+ }
33
+ };
34
+
22
35
  return `
23
36
  <div class="holder">
24
- <a ot-for="item in items" :class="'tab' + (active === item.id ? ' active' : '')" :href="item.href">
37
+ <a ot-for="item in items" :class="'tab' + (active === item.id ? ' active' : '')" :href="item.href || 'javascript:void(0)'" ot-click="select(item.id)">
25
38
  <i ot-if="item.icon">{{ item.icon }}</i>
26
39
  <span>{{ item.label }}</span>
27
40
  </a>
@@ -1,7 +1,7 @@
1
1
  .e-631be738
2
2
  {
3
3
  width: 100%;
4
- min-height: calc(100vh - 48px);
4
+ min-height: 320px;
5
5
  display: flex;
6
6
  align-items: center;
7
7
  justify-content: center;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onetype/framework",
3
- "version": "2.0.30",
3
+ "version": "2.0.32",
4
4
  "description": "OneType Framework — Full-stack isomorphic JavaScript framework built from scratch. One addon abstraction powers databases, servers, commands, pages, directives, queues, and more.",
5
5
  "type": "module",
6
6
  "main": "lib/load.js",