@vixt/layer-shared 0.6.8

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/loading.html ADDED
@@ -0,0 +1,135 @@
1
+ <!-- copy from https://tobiasahlin.com/spinkit/ -->
2
+ <div class="loader">
3
+ <div class="sk-chase">
4
+ <div class="sk-chase-dot"></div>
5
+ <div class="sk-chase-dot"></div>
6
+ <div class="sk-chase-dot"></div>
7
+ <div class="sk-chase-dot"></div>
8
+ <div class="sk-chase-dot"></div>
9
+ <div class="sk-chase-dot"></div>
10
+ </div>
11
+ </div>
12
+
13
+ <style>
14
+ html,
15
+ body,
16
+ #app {
17
+ height: 100%;
18
+ margin: 0;
19
+ }
20
+
21
+ html {
22
+ --loader-color: #333;
23
+ }
24
+
25
+ html.dark {
26
+ --loader-color: #fff;
27
+ background-color: #121212;
28
+ }
29
+
30
+ .loader {
31
+ height: 100%;
32
+ display: flex;
33
+ flex-direction: column;
34
+ align-items: center;
35
+ justify-content: center;
36
+ }
37
+
38
+ .sk-chase {
39
+ width: 40px;
40
+ height: 40px;
41
+ position: relative;
42
+ animation: sk-chase 2.5s infinite linear both;
43
+ }
44
+
45
+ .sk-chase-dot {
46
+ width: 100%;
47
+ height: 100%;
48
+ position: absolute;
49
+ left: 0;
50
+ top: 0;
51
+ animation: sk-chase-dot 2s infinite ease-in-out both;
52
+ }
53
+
54
+ .sk-chase-dot:before {
55
+ content: '';
56
+ display: block;
57
+ width: 25%;
58
+ height: 25%;
59
+ background-color: var(--loader-color);
60
+ border-radius: 100%;
61
+ animation: sk-chase-dot-before 2s infinite ease-in-out both;
62
+ }
63
+
64
+ .sk-chase-dot:nth-child(1) {
65
+ animation-delay: -1.1s;
66
+ }
67
+
68
+ .sk-chase-dot:nth-child(2) {
69
+ animation-delay: -1s;
70
+ }
71
+
72
+ .sk-chase-dot:nth-child(3) {
73
+ animation-delay: -0.9s;
74
+ }
75
+
76
+ .sk-chase-dot:nth-child(4) {
77
+ animation-delay: -0.8s;
78
+ }
79
+
80
+ .sk-chase-dot:nth-child(5) {
81
+ animation-delay: -0.7s;
82
+ }
83
+
84
+ .sk-chase-dot:nth-child(6) {
85
+ animation-delay: -0.6s;
86
+ }
87
+
88
+ .sk-chase-dot:nth-child(1):before {
89
+ animation-delay: -1.1s;
90
+ }
91
+
92
+ .sk-chase-dot:nth-child(2):before {
93
+ animation-delay: -1s;
94
+ }
95
+
96
+ .sk-chase-dot:nth-child(3):before {
97
+ animation-delay: -0.9s;
98
+ }
99
+
100
+ .sk-chase-dot:nth-child(4):before {
101
+ animation-delay: -0.8s;
102
+ }
103
+
104
+ .sk-chase-dot:nth-child(5):before {
105
+ animation-delay: -0.7s;
106
+ }
107
+
108
+ .sk-chase-dot:nth-child(6):before {
109
+ animation-delay: -0.6s;
110
+ }
111
+
112
+ @keyframes sk-chase {
113
+ 100% {
114
+ transform: rotate(360deg);
115
+ }
116
+ }
117
+
118
+ @keyframes sk-chase-dot {
119
+ 80%,
120
+ 100% {
121
+ transform: rotate(360deg);
122
+ }
123
+ }
124
+
125
+ @keyframes sk-chase-dot-before {
126
+ 50% {
127
+ transform: scale(0.4);
128
+ }
129
+
130
+ 100%,
131
+ 0% {
132
+ transform: scale(1);
133
+ }
134
+ }
135
+ </style>
package/package.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@vixt/layer-shared",
3
+ "type": "module",
4
+ "version": "0.6.8",
5
+ "main": "vixt.config.ts",
6
+ "dependencies": {
7
+ "@unocss/reset": "catalog:vite",
8
+ "vixt": "workspace:*"
9
+ }
10
+ }
@@ -0,0 +1,8 @@
1
+ import { defineAppConfig } from 'vixt/client'
2
+
3
+ const env = useEnv()
4
+ console.log('env:', env)
5
+
6
+ export default defineAppConfig({
7
+ name: 'layer-shared',
8
+ })
@@ -0,0 +1,3 @@
1
+ export function useEnv() {
2
+ return getEnv()
3
+ }
@@ -0,0 +1 @@
1
+ export const ENV = { error: 'ENV should be overridden' }
@@ -0,0 +1,3 @@
1
+ export function useEnv() {
2
+ return getEnv()
3
+ }
@@ -0,0 +1,3 @@
1
+ # Modules
2
+
3
+ shared modules for all apps
@@ -0,0 +1,6 @@
1
+ import { defineVixtModule } from 'vixt'
2
+
3
+ export default defineVixtModule(() => {
4
+ console.log('layer-shared module1 loaded')
5
+ return false
6
+ })
@@ -0,0 +1,6 @@
1
+ import { defineVixtModule } from 'vixt'
2
+
3
+ export default defineVixtModule(() => {
4
+ console.log('layer-shared module2 loaded')
5
+ return false
6
+ })
@@ -0,0 +1,3 @@
1
+ # Plugins
2
+
3
+ shared plugins for all apps
@@ -0,0 +1,15 @@
1
+ import { defineVixtPlugin } from 'vixt/client'
2
+
3
+ declare module '@vixt/core/client' {
4
+ interface VixtAppConfig {
5
+ pluginConfig?: string
6
+ }
7
+ }
8
+
9
+ export default defineVixtPlugin((vixtApp) => {
10
+ console.log('vixtApp:', vixtApp.appConfig)
11
+ console.log('layer-shared plugin1 loaded')
12
+
13
+ // @ts-expect-error
14
+ vixtApp.appConfig.pluginConfig = 0
15
+ })
@@ -0,0 +1,5 @@
1
+ import { defineVixtPlugin } from 'vixt/client'
2
+
3
+ export default defineVixtPlugin(() => {
4
+ console.log('layer-shared plugin2 loaded')
5
+ })
@@ -0,0 +1,3 @@
1
+ export function getEnv() {
2
+ return ENV
3
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": ["../vue/.vixt/tsconfig.json", "../react/.vixt/tsconfig.json"]
3
+ }
package/uno.config.ts ADDED
@@ -0,0 +1,17 @@
1
+ import { defineConfig, presetAttributify, presetWind3, transformerAttributifyJsx, transformerDirectives, transformerVariantGroup } from 'unocss'
2
+
3
+ export default defineConfig({
4
+ presets: [
5
+ presetWind3(),
6
+ presetAttributify(),
7
+ ],
8
+ transformers: [
9
+ transformerDirectives(),
10
+ transformerVariantGroup(),
11
+ transformerAttributifyJsx(),
12
+ ],
13
+ shortcuts: [
14
+ ['btn', 'px-4 py-1 rounded inline-block bg-teal-700 text-white cursor-pointer !outline-none hover:bg-teal-800 disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50'],
15
+ ['icon-btn', 'inline-block cursor-pointer select-none opacity-75 transition duration-200 ease-in-out hover:opacity-100 hover:text-teal-600'],
16
+ ],
17
+ })
package/vixt.config.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { defineVixtConfig } from 'vixt'
2
+
3
+ export default defineVixtConfig({
4
+ meta: { name: 'layer-shared' },
5
+ app: {
6
+ css: ['@unocss/reset/tailwind.css'],
7
+ },
8
+ })