@symbo.ls/preview 2.11.398 → 2.11.446

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.
package/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  'use strict'
2
2
 
3
3
  export * from './pages/Styleguide'
4
+ export * from './pages/Component'
4
5
  export * from './pages/Components'
package/package.json CHANGED
@@ -1,11 +1,8 @@
1
1
  {
2
2
  "name": "@symbo.ls/preview",
3
- "version": "2.11.398",
3
+ "version": "2.11.446",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "d3cb027daada2cda9943517e98ffc67e0170a763",
7
- "dependencies": {
8
- "smbls": "latest"
9
- },
6
+ "gitHead": "d042e0c4fc9379b0ca7584f6405cfa2e7c1301d4",
10
7
  "source": "src/index.js"
11
8
  }
@@ -0,0 +1,67 @@
1
+ 'use strict'
2
+
3
+ export const Component = {
4
+ extend: 'Flex',
5
+ props: {
6
+ align: 'center center',
7
+ minHeight: '100vh'
8
+ },
9
+
10
+ smblsHeader: {
11
+ if: () => {
12
+ const urlParams = new URLSearchParams(window.location.search)
13
+ return !urlParams.get('hideUi') || !urlParams.get('fullsize')
14
+ },
15
+ extend: 'Flex',
16
+ props: {
17
+ align: 'center space-between',
18
+ position: 'absolute',
19
+ inset: '0 0 auto 0',
20
+ background: 'black 0.15',
21
+ padding: 'Z A'
22
+ },
23
+ 'Link+SquareButton': { Icon: { name: 'symbols', fontSize: 'B' }, href: '/' },
24
+ OpenInSymbols: () => {
25
+ const urlParams = new URLSearchParams(window.location.search)
26
+ const key = urlParams.get('key') || 'Logo'
27
+ const screenshot = urlParams.get('screenshot')
28
+ const activeProject = window.location.host.split('.')[0]
29
+ return {
30
+ extends: ['Link', 'Button'],
31
+ target: '_blank',
32
+ padding: 'Z A',
33
+ href: `https://symbols.app/?activeProject=${activeProject}&selected=${key}`,
34
+ // href: () => `https://symbols.app/?activeProject=${window.location.host.split('.')[0]}&selected=${key}`,
35
+ text: screenshot ? window.location.host : 'Open in Symbols'
36
+ }
37
+ }
38
+ },
39
+
40
+ Component: (el, s, ctx) => {
41
+ const urlParams = new URLSearchParams(window.location.search)
42
+ const width = urlParams.get('width') || '860px'
43
+ const height = urlParams.get('height') || '560px'
44
+ // const theme = urlParams.get('theme') || 'dark'
45
+ const key = urlParams.get('key') || 'Logo'
46
+ const hideUi = urlParams.get('hideUi')
47
+ const fullsize = hideUi || urlParams.get('fullsize')
48
+ const factory = key.startsWith('/') ? 'pages' : 'components'
49
+ const schema = ctx.schema[factory][key]
50
+ return {
51
+ key,
52
+ extend: 'Flex',
53
+ state: schema.state,
54
+ props: () => ({
55
+ class: 'component',
56
+ align: 'center center',
57
+ boxSize: fullsize ? '100dvh 100dvw' : `${height} ${width}`
58
+ }),
59
+ [key]: fullsize
60
+ ? {
61
+ ...schema.props?.demoComponent,
62
+ boxSize: '100dvh 100dvw'
63
+ }
64
+ : schema.props?.demoComponent || {}
65
+ }
66
+ }
67
+ }
@@ -1,7 +1,5 @@
1
1
  'use strict'
2
2
 
3
- import { Avatar, SearchWithButton } from '@symbo.ls/uikit'
4
-
5
3
  export const ComponentsPage = {
6
4
  extend: 'Flex',
7
5
 
@@ -52,7 +50,7 @@ export const ComponentsPage = {
52
50
  Avatar: {},
53
51
  AvatarIndicator: {},
54
52
  AvatarBundle: {
55
- childExtend: Avatar,
53
+ childExtend: 'Avatar',
56
54
  ...[{}, {}, {}]
57
55
  },
58
56
  AvatarChooser: {
@@ -218,7 +216,7 @@ export const ComponentsPage = {
218
216
  }
219
217
  },
220
218
  Search: {
221
- extend: SearchWithButton,
219
+ extend: 'SearchWithButton',
222
220
  props: {
223
221
  minWidth: 'G+C',
224
222
  minHeight: 'C+X',