@skyservice-developers/vue-dev-kit 1.5.11 → 2.0.0

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 (57) hide show
  1. package/README.md +96 -15
  2. package/dist/api-BOvdjB3h.js +266 -0
  3. package/dist/api-D5C6FvTr.cjs +1 -0
  4. package/dist/components/BaseTeleport.vue.d.ts +14 -0
  5. package/dist/components/Dialog.vue.d.ts +28 -0
  6. package/dist/components/DialogModal.vue.d.ts +28 -0
  7. package/dist/components/DialogNext.vue.d.ts +28 -0
  8. package/dist/components/Header.vue.d.ts +37 -0
  9. package/dist/components/Modal.vue.d.ts +30 -0
  10. package/dist/components/SkyButton.vue.d.ts +22 -0
  11. package/dist/components/SkySelect.vue.d.ts +16 -0
  12. package/dist/components/index.d.ts +8 -0
  13. package/dist/index.d.ts +3 -0
  14. package/dist/sdk/api.d.ts +54 -0
  15. package/dist/sdk/bridge.d.ts +43 -0
  16. package/dist/sdk/index.d.ts +6 -0
  17. package/dist/sdk/types.d.ts +73 -0
  18. package/dist/sdk/webview.d.ts +16 -0
  19. package/dist/sdk.cjs +1 -0
  20. package/dist/sdk.js +33 -0
  21. package/dist/style.css +1 -0
  22. package/dist/vue-dev-kit.cjs +1 -0
  23. package/dist/vue-dev-kit.js +903 -0
  24. package/package.json +32 -43
  25. package/dist/vue2/style.css +0 -1
  26. package/dist/vue2/vue-dev-kit.cjs +0 -1
  27. package/dist/vue2/vue-dev-kit.js +0 -2622
  28. package/dist/vue3/style.css +0 -1
  29. package/dist/vue3/vue-dev-kit.cjs +0 -1
  30. package/dist/vue3/vue-dev-kit.js +0 -2338
  31. package/src/index.js +0 -9
  32. package/src/shared/index.js +0 -1
  33. package/src/shared/types/index.d.ts +0 -72
  34. package/src/shared/utils/index.js +0 -2
  35. package/src/shared/utils/parentBridge.js +0 -84
  36. package/src/shared/utils/webviewCheck.js +0 -54
  37. package/src/styles/scrollbar.css +0 -17
  38. package/src/vue2/components/BaseTeleport.vue +0 -16
  39. package/src/vue2/components/Dialog.vue +0 -106
  40. package/src/vue2/components/DialogModal.vue +0 -439
  41. package/src/vue2/components/DialogNext.vue +0 -379
  42. package/src/vue2/components/Header.vue +0 -466
  43. package/src/vue2/components/Modal.vue +0 -252
  44. package/src/vue2/components/SkyButton.vue +0 -144
  45. package/src/vue2/components/SkySelect.vue +0 -327
  46. package/src/vue2/components/index.js +0 -6
  47. package/src/vue2/index.js +0 -2
  48. package/src/vue3/components/BaseTeleport.vue +0 -16
  49. package/src/vue3/components/Dialog.vue +0 -97
  50. package/src/vue3/components/DialogModal.vue +0 -458
  51. package/src/vue3/components/DialogNext.vue +0 -427
  52. package/src/vue3/components/Header.vue +0 -505
  53. package/src/vue3/components/Modal.vue +0 -253
  54. package/src/vue3/components/SkyButton.vue +0 -140
  55. package/src/vue3/components/SkySelect.vue +0 -379
  56. package/src/vue3/components/index.js +0 -8
  57. package/src/vue3/index.js +0 -2
@@ -1,144 +0,0 @@
1
- <template>
2
- <button
3
- class="sky-btn"
4
- :class="[
5
- `sky-btn-${variant}`,
6
- {
7
- 'sky-btn-block': block,
8
- 'sky-btn-loading': loading,
9
- 'sky-btn-icon': icon,
10
- }
11
- ]"
12
- :disabled="disabled || loading"
13
- v-bind="$attrs"
14
- >
15
- <span v-if="loading" class="sky-btn-spinner"></span>
16
- <slot></slot>
17
- </button>
18
- </template>
19
-
20
- <script>
21
- export default {
22
- name: 'SkyButton',
23
- inheritAttrs: false,
24
- props: {
25
- variant: {
26
- type: String,
27
- default: 'primary',
28
- validator: (v) => ['primary', 'danger', 'secondary', 'outline'].includes(v)
29
- },
30
- loading: {
31
- type: Boolean,
32
- default: false
33
- },
34
- disabled: {
35
- type: Boolean,
36
- default: false
37
- },
38
- block: {
39
- type: Boolean,
40
- default: false
41
- },
42
- icon: {
43
- type: Boolean,
44
- default: false
45
- }
46
- }
47
- }
48
- </script>
49
-
50
- <style scoped>
51
- .sky-btn {
52
- display: inline-flex;
53
- align-items: center;
54
- justify-content: center;
55
- gap: 8px;
56
- padding: var(--sky-btn-padding, 16px 20px);
57
- border: var(--sky-btn-border, none);
58
- border-radius: var(--sky-btn-radius, 6px);
59
- font-size: var(--sky-btn-font-size, 14px);
60
- font-weight: var(--sky-btn-font-weight, 500);
61
- line-height: 1;
62
- cursor: pointer;
63
- white-space: nowrap;
64
- user-select: none;
65
- }
66
-
67
- .sky-btn-icon {
68
- padding: var(--sky-btn-icon-padding, 10px);
69
- border-radius: var(--sky-btn-icon-radius, 6px);
70
- }
71
-
72
- .sky-btn-block {
73
- width: 100%;
74
- }
75
-
76
- .sky-btn:disabled {
77
- opacity: 0.6;
78
- cursor: not-allowed;
79
- }
80
-
81
- /* Primary */
82
- .sky-btn-primary {
83
- background: var(--sky-btn-primary-bg, #24973f);
84
- color: var(--sky-btn-primary-color, #fff);
85
- }
86
- .sky-btn-primary:hover:not(:disabled) {
87
- background: var(--sky-btn-primary-hover-bg, #1e7a33);
88
- }
89
- .sky-btn-primary:active:not(:disabled) {
90
- background: var(--sky-btn-primary-active-bg, #196b2c);
91
- }
92
-
93
- /* Danger */
94
- .sky-btn-danger {
95
- background: var(--sky-btn-danger-bg, #dc2626);
96
- color: var(--sky-btn-danger-color, #fff);
97
- }
98
- .sky-btn-danger:hover:not(:disabled) {
99
- background: var(--sky-btn-danger-hover-bg, #b91c1c);
100
- }
101
- .sky-btn-danger:active:not(:disabled) {
102
- background: var(--sky-btn-danger-active-bg, #991b1b);
103
- }
104
-
105
- /* Secondary */
106
- .sky-btn-secondary {
107
- background: var(--sky-btn-secondary-bg, #f3f4f6);
108
- color: var(--sky-btn-secondary-color, #374151);
109
- }
110
- .sky-btn-secondary:hover:not(:disabled) {
111
- background: var(--sky-btn-secondary-hover-bg, #e5e7eb);
112
- }
113
- .sky-btn-secondary:active:not(:disabled) {
114
- background: var(--sky-btn-secondary-active-bg, #d1d5db);
115
- }
116
-
117
- /* Outline */
118
- .sky-btn-outline {
119
- background: var(--sky-btn-outline-bg, transparent);
120
- color: var(--sky-btn-outline-color, #374151);
121
- border: var(--sky-btn-border, 1px solid #d1d5db);
122
- }
123
- .sky-btn-outline:hover:not(:disabled) {
124
- background: var(--sky-btn-outline-hover-bg, #f3f4f6);
125
- }
126
- .sky-btn-outline:active:not(:disabled) {
127
- background: var(--sky-btn-outline-active-bg, #e5e7eb);
128
- }
129
-
130
- /* Loading spinner */
131
- .sky-btn-spinner {
132
- width: 14px;
133
- height: 14px;
134
- border: 2px solid currentColor;
135
- border-top-color: transparent;
136
- border-radius: 50%;
137
- animation: sky-btn-spin 0.6s linear infinite;
138
- flex-shrink: 0;
139
- }
140
-
141
- @keyframes sky-btn-spin {
142
- to { transform: rotate(360deg); }
143
- }
144
- </style>
@@ -1,327 +0,0 @@
1
- <template>
2
- <div
3
- ref="root"
4
- class="sky-select"
5
- :class="{
6
- 'sky-select-block': block,
7
- 'sky-select-open': open,
8
- 'sky-select-disabled': disabled,
9
- }"
10
- >
11
- <button
12
- type="button"
13
- class="sky-select-trigger"
14
- :disabled="disabled"
15
- @click="toggle"
16
- @keydown="onKeydown"
17
- >
18
- <span
19
- class="sky-select-value"
20
- :class="{ 'sky-select-placeholder': selectedOption === null }"
21
- >
22
- {{ selectedOption ? selectedOption.label : placeholder }}
23
- </span>
24
- <svg class="sky-select-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true">
25
- <path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
26
- </svg>
27
- </button>
28
-
29
- <template v-if="open">
30
- <portal v-if="teleport" to="sky-select-portal">
31
- <div
32
- class="sky-select-dropdown sky-select-dropdown-teleported"
33
- :style="dropdownStyle"
34
- >
35
- <div
36
- v-for="(option, idx) in normalizedOptions"
37
- :key="option.value"
38
- class="sky-select-option"
39
- :class="{
40
- 'sky-select-option-selected': option.value === value,
41
- 'sky-select-option-focused': idx === focusedIdx,
42
- }"
43
- @click="select(option)"
44
- @mouseenter="focusedIdx = idx"
45
- >
46
- <span>{{ option.label }}</span>
47
- <svg v-if="option.value === value" class="sky-select-check" viewBox="0 0 16 16" fill="none" aria-hidden="true">
48
- <path d="M3 8l4 4 6-6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
49
- </svg>
50
- </div>
51
- </div>
52
- </portal>
53
- <div v-else class="sky-select-dropdown">
54
- <div
55
- v-for="(option, idx) in normalizedOptions"
56
- :key="option.value"
57
- class="sky-select-option"
58
- :class="{
59
- 'sky-select-option-selected': option.value === value,
60
- 'sky-select-option-focused': idx === focusedIdx,
61
- }"
62
- @click="select(option)"
63
- @mouseenter="focusedIdx = idx"
64
- >
65
- <span>{{ option.label }}</span>
66
- <svg v-if="option.value === value" class="sky-select-check" viewBox="0 0 16 16" fill="none" aria-hidden="true">
67
- <path d="M3 8l4 4 6-6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
68
- </svg>
69
- </div>
70
- </div>
71
- </template>
72
- </div>
73
- </template>
74
-
75
- <script>
76
- export default {
77
- name: 'SkySelect',
78
- inheritAttrs: false,
79
- props: {
80
- value: {
81
- default: null,
82
- },
83
- options: {
84
- type: Array,
85
- default: () => [],
86
- },
87
- placeholder: {
88
- type: String,
89
- default: '',
90
- },
91
- disabled: {
92
- type: Boolean,
93
- default: false,
94
- },
95
- block: {
96
- type: Boolean,
97
- default: false,
98
- },
99
- teleport: {
100
- type: Boolean,
101
- default: false,
102
- },
103
- },
104
- data() {
105
- return {
106
- open: false,
107
- focusedIdx: -1,
108
- dropdownStyle: {},
109
- };
110
- },
111
- computed: {
112
- normalizedOptions() {
113
- return this.options.map((opt) =>
114
- typeof opt === 'string' ? { label: opt, value: opt } : opt
115
- );
116
- },
117
- selectedOption() {
118
- return this.normalizedOptions.find((o) => o.value === this.value) ?? null;
119
- },
120
- },
121
- methods: {
122
- calcDropdownStyle() {
123
- if (!this.teleport || !this.$refs.root) return;
124
- const rect = this.$refs.root.getBoundingClientRect();
125
- this.dropdownStyle = {
126
- position: 'fixed',
127
- top: `${rect.bottom + 4}px`,
128
- left: `${rect.left}px`,
129
- width: `${rect.width}px`,
130
- zIndex: 'var(--sky-select-dropdown-z-index, 9999)',
131
- };
132
- },
133
- toggle() {
134
- if (this.disabled) return;
135
- this.open ? this.close() : this.openDropdown();
136
- },
137
- openDropdown() {
138
- this.open = true;
139
- this.focusedIdx = this.normalizedOptions.findIndex((o) => o.value === this.value);
140
- this.calcDropdownStyle();
141
- this.$nextTick(() => document.addEventListener('mousedown', this.onOutsideClick));
142
- if (this.teleport) {
143
- window.addEventListener('scroll', this.onScrollOrResize, true);
144
- window.addEventListener('resize', this.onScrollOrResize);
145
- }
146
- },
147
- close() {
148
- this.open = false;
149
- document.removeEventListener('mousedown', this.onOutsideClick);
150
- window.removeEventListener('scroll', this.onScrollOrResize, true);
151
- window.removeEventListener('resize', this.onScrollOrResize);
152
- },
153
- select(option) {
154
- this.$emit('input', option.value);
155
- this.close();
156
- },
157
- onOutsideClick(e) {
158
- if (!this.$refs.root.contains(e.target)) this.close();
159
- },
160
- onScrollOrResize() {
161
- this.calcDropdownStyle();
162
- },
163
- onKeydown(e) {
164
- if (!this.open) {
165
- if (e.key === 'Enter' || e.key === ' ') {
166
- e.preventDefault();
167
- this.openDropdown();
168
- }
169
- return;
170
- }
171
- if (e.key === 'Escape') {
172
- this.close();
173
- } else if (e.key === 'ArrowDown') {
174
- e.preventDefault();
175
- this.focusedIdx = Math.min(this.focusedIdx + 1, this.normalizedOptions.length - 1);
176
- } else if (e.key === 'ArrowUp') {
177
- e.preventDefault();
178
- this.focusedIdx = Math.max(this.focusedIdx - 1, 0);
179
- } else if (e.key === 'Enter') {
180
- e.preventDefault();
181
- if (this.focusedIdx >= 0) this.select(this.normalizedOptions[this.focusedIdx]);
182
- }
183
- },
184
- },
185
- beforeDestroy() {
186
- document.removeEventListener('mousedown', this.onOutsideClick);
187
- window.removeEventListener('scroll', this.onScrollOrResize, true);
188
- window.removeEventListener('resize', this.onScrollOrResize);
189
- },
190
- };
191
- </script>
192
-
193
- <style scoped>
194
- .sky-select {
195
- position: relative;
196
- display: inline-block;
197
- font-size: var(--sky-select-font-size, 14px);
198
- }
199
-
200
- .sky-select-block {
201
- display: block;
202
- width: 100%;
203
- }
204
-
205
- .sky-select-block .sky-select-trigger {
206
- width: 100%;
207
- }
208
-
209
- /* Trigger */
210
- .sky-select-trigger {
211
- display: inline-flex;
212
- align-items: center;
213
- justify-content: space-between;
214
- gap: 8px;
215
- width: 100%;
216
- padding: var(--sky-select-padding, 10px 14px);
217
- background: var(--sky-select-bg, #fff);
218
- border: var(--sky-select-border, 1px solid #d1d5db);
219
- border-radius: var(--sky-select-radius, 6px);
220
- font-size: inherit;
221
- font-weight: var(--sky-select-font-weight, 400);
222
- color: var(--sky-select-color, #374151);
223
- cursor: pointer;
224
- user-select: none;
225
- text-align: left;
226
- white-space: nowrap;
227
- }
228
-
229
- .sky-select-trigger:hover:not(:disabled) {
230
- border-color: var(--sky-select-border-hover, #9ca3af);
231
- }
232
-
233
- .sky-select-open .sky-select-trigger {
234
- border-color: var(--sky-select-border-focus, #6b7280);
235
- outline: none;
236
- }
237
-
238
- .sky-select-trigger:focus-visible {
239
- outline: 2px solid var(--sky-select-focus-ring, #24973f);
240
- outline-offset: 2px;
241
- }
242
-
243
- .sky-select-disabled .sky-select-trigger {
244
- opacity: 0.6;
245
- cursor: not-allowed;
246
- }
247
-
248
- /* Value / Placeholder */
249
- .sky-select-value {
250
- overflow: hidden;
251
- text-overflow: ellipsis;
252
- flex: 1;
253
- min-width: 0;
254
- }
255
-
256
- .sky-select-placeholder {
257
- color: var(--sky-select-placeholder-color, #9ca3af);
258
- }
259
-
260
- /* Chevron */
261
- .sky-select-chevron {
262
- width: 16px;
263
- height: 16px;
264
- flex-shrink: 0;
265
- color: var(--sky-select-chevron-color, #6b7280);
266
- transition: transform 0.15s ease;
267
- }
268
-
269
- .sky-select-open .sky-select-chevron {
270
- transform: rotate(180deg);
271
- }
272
-
273
- /* Dropdown */
274
- .sky-select-dropdown {
275
- position: absolute;
276
- top: calc(100% + 4px);
277
- left: 0;
278
- right: 0;
279
- z-index: var(--sky-select-dropdown-z-index, 100);
280
- background: var(--sky-select-dropdown-bg, #fff);
281
- border: var(--sky-select-dropdown-border, 1px solid #d1d5db);
282
- border-radius: var(--sky-select-dropdown-radius, 6px);
283
- box-shadow: var(--sky-select-dropdown-shadow, 0 4px 12px rgba(0, 0, 0, 0.1));
284
- max-height: var(--sky-select-dropdown-max-height, 220px);
285
- overflow-y: auto;
286
- padding: 4px;
287
- }
288
-
289
- .sky-select-dropdown-teleported {
290
- position: fixed;
291
- background: var(--sky-select-dropdown-bg, #fff);
292
- border: var(--sky-select-dropdown-border, 1px solid #d1d5db);
293
- border-radius: var(--sky-select-dropdown-radius, 6px);
294
- box-shadow: var(--sky-select-dropdown-shadow, 0 4px 12px rgba(0, 0, 0, 0.1));
295
- max-height: var(--sky-select-dropdown-max-height, 220px);
296
- overflow-y: auto;
297
- padding: 4px;
298
- }
299
-
300
- /* Option */
301
- .sky-select-option {
302
- display: flex;
303
- align-items: center;
304
- justify-content: space-between;
305
- padding: var(--sky-select-option-padding, 9px 10px);
306
- border-radius: var(--sky-select-option-radius, 4px);
307
- cursor: pointer;
308
- color: var(--sky-select-option-color, #374151);
309
- }
310
-
311
- .sky-select-option-focused,
312
- .sky-select-option:hover {
313
- background: var(--sky-select-option-hover-bg, #f3f4f6);
314
- }
315
-
316
- .sky-select-option-selected {
317
- color: var(--sky-select-option-selected-color, #24973f);
318
- font-weight: 500;
319
- }
320
-
321
- .sky-select-check {
322
- width: 14px;
323
- height: 14px;
324
- flex-shrink: 0;
325
- color: var(--sky-select-check-color, #24973f);
326
- }
327
- </style>
@@ -1,6 +0,0 @@
1
- export { default as Header } from './Header.vue'
2
- export { default as Modal } from './Modal.vue'
3
- export { default as Dialog } from './Dialog.vue'
4
- export { default as SkyButton } from './SkyButton.vue'
5
- export { default as SkySelect } from './SkySelect.vue'
6
- export { default as BaseTeleport } from './BaseTeleport.vue'
package/src/vue2/index.js DELETED
@@ -1,2 +0,0 @@
1
- export * from './components'
2
- import '../styles/scrollbar.css'
@@ -1,16 +0,0 @@
1
- <template>
2
- <teleport :to="to">
3
- <slot />
4
- </teleport>
5
- </template>
6
-
7
- <script>
8
- export default {
9
- props: {
10
- to: {
11
- type: String,
12
- default: 'body',
13
- },
14
- },
15
- }
16
- </script>
@@ -1,97 +0,0 @@
1
- <template>
2
- <component
3
- :is="dialogComponent"
4
- v-model="isOpen"
5
- :title="title"
6
- :subtitle="subtitle"
7
- :z-index="zIndex"
8
- :close-text="closeText"
9
- :close-on-esc="closeOnEsc"
10
- :has-buttons="!!$slots.buttons"
11
- @close="$emit('close')"
12
- @save="$emit('save')"
13
- >
14
- <slot></slot>
15
- <template v-if="$slots.buttons" #buttons>
16
- <slot name="buttons"></slot>
17
- </template>
18
- </component>
19
- </template>
20
-
21
- <script setup>
22
- import { computed, ref, onMounted } from 'vue'
23
- import DialogModal from './DialogModal.vue'
24
- import DialogNext from './DialogNext.vue'
25
-
26
- const props = defineProps({
27
- modelValue: {
28
- type: Boolean,
29
- default: false
30
- },
31
- title: {
32
- type: String,
33
- default: ''
34
- },
35
- subtitle: {
36
- type: String,
37
- default: ''
38
- },
39
- zIndex: {
40
- type: [Number, String],
41
- default: null
42
- },
43
- closeText: {
44
- type: String,
45
- default: ''
46
- },
47
- closeOnEsc: {
48
- type: Boolean,
49
- default: true
50
- },
51
- // Force specific mode (overrides URL parameter)
52
- mode: {
53
- type: String,
54
- default: null, // 'next' | 'classic' | null (auto-detect)
55
- validator: (value) => [null, 'next', 'classic'].includes(value)
56
- }
57
- })
58
-
59
- const emit = defineEmits(['update:modelValue', 'close', 'save'])
60
-
61
- const isOpen = computed({
62
- get: () => props.modelValue,
63
- set: (value) => emit('update:modelValue', value)
64
- })
65
-
66
- // Detect rocketMode from URL
67
- const rocketMode = ref(true) // default to DialogNext
68
-
69
- onMounted(() => {
70
- try {
71
- const urlParams = new URLSearchParams(window.location.search)
72
- const rocketParam = urlParams.get('rocketMode')
73
-
74
- if (rocketParam === 'false') {
75
- rocketMode.value = false
76
- } else {
77
- // true or not specified = DialogNext
78
- rocketMode.value = true
79
- }
80
- } catch {
81
- rocketMode.value = true
82
- }
83
- })
84
-
85
- const dialogComponent = computed(() => {
86
- // If mode is explicitly set, use it
87
- if (props.mode === 'next') {
88
- return DialogNext
89
- }
90
- if (props.mode === 'classic') {
91
- return DialogModal
92
- }
93
-
94
- // Auto-detect based on URL parameter
95
- return rocketMode.value ? DialogNext : DialogModal
96
- })
97
- </script>