@umbra.ui/core 0.1.8 → 0.1.9
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/dist/components/controls/Dropdown/types.js +2 -1
- package/dist/components/controls/SegmentedControl/types.js +2 -1
- package/dist/components/dialogs/Alert/types.js +2 -1
- package/dist/components/dialogs/Toast/types.js +4 -1
- package/dist/components/dialogs/Toast/useToast.js +13 -9
- package/dist/components/indicators/Tooltip/tooltip.js +7 -4
- package/dist/components/indicators/Tooltip/types.js +2 -1
- package/dist/components/indicators/Tooltip/useTooltip.js +10 -5
- package/dist/components/inputs/Tags/tag-bar-styles.js +6 -3
- package/dist/components/inputs/Tags/types.js +58 -15
- package/dist/components/inputs/search/types.js +2 -1
- package/dist/components/navigation/adaptive/types.js +2 -1
- package/dist/components/navigation/adaptive/useAdaptiveLayout.js +14 -10
- package/dist/components/navigation/adaptive/useBreakpoints.js +5 -1
- package/dist/components/navigation/adaptive/useContainerMonitor.js +20 -16
- package/dist/components/navigation/adaptive/useViewAnimation.js +17 -10
- package/dist/components/navigation/adaptive/useViewResize.js +10 -6
- package/dist/components/navigation/navstack/useNavigationStack.js +13 -10
- package/dist/components/navigation/slideover/useSlideoverController.js +23 -19
- package/dist/components/navigation/splitview/useSplitViewController.js +26 -22
- package/dist/components/navigation/tabcontroller/types.js +2 -1
- package/dist/components/navigation/tabcontroller/useTabController.js +8 -4
- package/dist/components/navigation/types.js +2 -1
- package/dist/components/pickers/CollectionPicker/types.js +2 -1
- package/dist/components/pickers/ColorPicker/colors.js +29 -26
- package/dist/components/pickers/FilePicker/types.js +2 -1
- package/dist/index.js +172 -73
- package/dist/index.mjs +77 -0
- package/dist/readme.d.ts.map +1 -1
- package/dist/readme.js +13 -12
- package/dist/theme.js +61 -45
- package/dist/themes/crimson-dark.js +5 -2
- package/dist/themes/cyan-light.js +5 -2
- package/dist/themes/dark.js +5 -2
- package/dist/themes/gold-dark.js +5 -2
- package/dist/themes/grass-dark.js +5 -2
- package/dist/themes/indigo.js +5 -2
- package/dist/themes/light.js +5 -2
- package/dist/themes/orange-dark.js +5 -2
- package/dist/themes/orange-light.js +5 -2
- package/package.json +6 -4
- package/src/readme.ts +2 -13
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ToastPresets = void 0;
|
|
1
4
|
// Preset configurations for common scenarios
|
|
2
|
-
|
|
5
|
+
exports.ToastPresets = {
|
|
3
6
|
quick: { duration: 2000 },
|
|
4
7
|
persistent: { duration: 0, dismissible: true },
|
|
5
8
|
important: {
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useToast = exports.ToastPlugin = void 0;
|
|
1
4
|
// useToast.ts
|
|
2
|
-
|
|
5
|
+
const vue_1 = require("vue");
|
|
3
6
|
const TOAST_INJECTION_KEY = Symbol("toast");
|
|
4
7
|
class ToastManager {
|
|
5
8
|
constructor() {
|
|
6
|
-
this.toasts = ref([]);
|
|
9
|
+
this.toasts = (0, vue_1.ref)([]);
|
|
7
10
|
this.toastIdCounter = 0;
|
|
8
|
-
this.currentToastStyle = ref("bar");
|
|
11
|
+
this.currentToastStyle = (0, vue_1.ref)("bar");
|
|
9
12
|
// Expose reactive toasts
|
|
10
|
-
this.toastList = computed(() => this.toasts.value);
|
|
13
|
+
this.toastList = (0, vue_1.computed)(() => this.toasts.value);
|
|
11
14
|
// Expose reactive toast style
|
|
12
|
-
this.toastStyle = computed(() => this.currentToastStyle.value);
|
|
15
|
+
this.toastStyle = (0, vue_1.computed)(() => this.currentToastStyle.value);
|
|
13
16
|
// Convenience methods
|
|
14
17
|
this.showSuccess = (title, description, options) => this.addToast({ title, description, toastType: "success", ...options });
|
|
15
18
|
this.showError = (title, description, options) => this.addToast({ title, description, toastType: "error", ...options });
|
|
@@ -35,7 +38,7 @@ class ToastManager {
|
|
|
35
38
|
};
|
|
36
39
|
this.toasts.value.push(toast);
|
|
37
40
|
// Trigger show animation on next tick
|
|
38
|
-
await nextTick();
|
|
41
|
+
await (0, vue_1.nextTick)();
|
|
39
42
|
const toastInstance = this.toasts.value.find((t) => t.id === id);
|
|
40
43
|
if (toastInstance) {
|
|
41
44
|
toastInstance.show = true;
|
|
@@ -58,7 +61,7 @@ class ToastManager {
|
|
|
58
61
|
// Singleton instance
|
|
59
62
|
let toastManager = null;
|
|
60
63
|
// Plugin for Vue app installation
|
|
61
|
-
|
|
64
|
+
exports.ToastPlugin = {
|
|
62
65
|
install(app) {
|
|
63
66
|
if (!toastManager) {
|
|
64
67
|
toastManager = new ToastManager();
|
|
@@ -67,9 +70,9 @@ export const ToastPlugin = {
|
|
|
67
70
|
},
|
|
68
71
|
};
|
|
69
72
|
// Composable for components
|
|
70
|
-
|
|
73
|
+
const useToast = () => {
|
|
71
74
|
// Try to inject first (if using plugin)
|
|
72
|
-
const injected = inject(TOAST_INJECTION_KEY, null);
|
|
75
|
+
const injected = (0, vue_1.inject)(TOAST_INJECTION_KEY, null);
|
|
73
76
|
// Fall back to singleton if not using plugin
|
|
74
77
|
if (!toastManager && !injected) {
|
|
75
78
|
toastManager = new ToastManager();
|
|
@@ -88,3 +91,4 @@ export const useToast = () => {
|
|
|
88
91
|
showInfo: manager.showInfo.bind(manager),
|
|
89
92
|
};
|
|
90
93
|
};
|
|
94
|
+
exports.useToast = useToast;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.vTooltip = void 0;
|
|
4
|
+
const useTooltip_1 = require("./useTooltip");
|
|
5
|
+
exports.vTooltip = {
|
|
3
6
|
mounted(el, binding) {
|
|
4
7
|
const config = typeof binding.value === "string"
|
|
5
8
|
? { content: binding.value }
|
|
6
9
|
: binding.value;
|
|
7
10
|
if (config && config.content) {
|
|
8
|
-
const { bindTooltip } = useTooltip(config);
|
|
11
|
+
const { bindTooltip } = (0, useTooltip_1.useTooltip)(config);
|
|
9
12
|
el._tooltipCleanup = bindTooltip(el);
|
|
10
13
|
}
|
|
11
14
|
},
|
|
@@ -20,7 +23,7 @@ export const vTooltip = {
|
|
|
20
23
|
? { content: binding.value }
|
|
21
24
|
: binding.value;
|
|
22
25
|
if (config && config.content) {
|
|
23
|
-
const { bindTooltip } = useTooltip(config);
|
|
26
|
+
const { bindTooltip } = (0, useTooltip_1.useTooltip)(config);
|
|
24
27
|
el._tooltipCleanup = bindTooltip(el);
|
|
25
28
|
}
|
|
26
29
|
},
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useTooltip = exports.useTooltipProvider = void 0;
|
|
4
|
+
const vue_1 = require("vue");
|
|
5
|
+
const tooltipState = (0, vue_1.reactive)({
|
|
3
6
|
isVisible: false,
|
|
4
7
|
content: "",
|
|
5
8
|
targetElement: null,
|
|
6
9
|
placement: "top",
|
|
7
10
|
offset: 2,
|
|
8
11
|
});
|
|
9
|
-
|
|
12
|
+
const useTooltipProvider = () => {
|
|
10
13
|
const showTooltip = async (element, config) => {
|
|
11
14
|
tooltipState.content = config.content;
|
|
12
15
|
tooltipState.placement = config.placement || "top";
|
|
@@ -25,8 +28,9 @@ export const useTooltipProvider = () => {
|
|
|
25
28
|
hideTooltip,
|
|
26
29
|
};
|
|
27
30
|
};
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
exports.useTooltipProvider = useTooltipProvider;
|
|
32
|
+
const useTooltip = (config) => {
|
|
33
|
+
const { showTooltip, hideTooltip } = (0, exports.useTooltipProvider)();
|
|
30
34
|
const bindTooltip = (element) => {
|
|
31
35
|
// Handle Vue component instances
|
|
32
36
|
let actualElement = element;
|
|
@@ -55,3 +59,4 @@ export const useTooltip = (config) => {
|
|
|
55
59
|
hideTooltip,
|
|
56
60
|
};
|
|
57
61
|
};
|
|
62
|
+
exports.useTooltip = useTooltip;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isCustomColor = exports.getTagBarStyle = void 0;
|
|
4
|
+
require("./theme.css");
|
|
2
5
|
// Base style templates for tag bar types
|
|
3
6
|
const baseStyles = {
|
|
4
7
|
default: {
|
|
@@ -228,6 +231,7 @@ const isCustomColor = (barStyle) => {
|
|
|
228
231
|
const predefinedStyles = ["primary", "secondary", "tertiary", "quaternary"];
|
|
229
232
|
return !predefinedStyles.includes(barStyle);
|
|
230
233
|
};
|
|
234
|
+
exports.isCustomColor = isCustomColor;
|
|
231
235
|
// Generate style for custom colors
|
|
232
236
|
const generateCustomColorStyle = (barType, customColor) => {
|
|
233
237
|
const baseStyle = baseStyles[barType] || baseStyles.default;
|
|
@@ -309,5 +313,4 @@ const getTagBarStyle = (type = "default", style = "primary") => {
|
|
|
309
313
|
};
|
|
310
314
|
}
|
|
311
315
|
};
|
|
312
|
-
|
|
313
|
-
export { getTagBarStyle, isCustomColor };
|
|
316
|
+
exports.getTagBarStyle = getTagBarStyle;
|
|
@@ -1,9 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.TagTheme = exports.TAG_STYLE_PRESETS = exports.COLOR_PRESETS = exports.createStyledTag = exports.generateTagStyle = exports.getColorMode = void 0;
|
|
40
|
+
const tinycolor2_1 = __importDefault(require("tinycolor2"));
|
|
41
|
+
const colors = __importStar(require("@umbra.ui/colors"));
|
|
42
|
+
const theme_1 = require("../../../theme");
|
|
4
43
|
// Color mode detection function that uses theme or falls back to system
|
|
5
|
-
|
|
6
|
-
const config = getThemeConfig();
|
|
44
|
+
const getColorMode = () => {
|
|
45
|
+
const config = (0, theme_1.getThemeConfig)();
|
|
7
46
|
// If a theme is provided, use its color mode
|
|
8
47
|
if (config?.customThemeColorMode) {
|
|
9
48
|
return config.customThemeColorMode;
|
|
@@ -13,6 +52,7 @@ export const getColorMode = () => {
|
|
|
13
52
|
? "dark"
|
|
14
53
|
: "light";
|
|
15
54
|
};
|
|
55
|
+
exports.getColorMode = getColorMode;
|
|
16
56
|
// Size presets
|
|
17
57
|
const SIZE_PRESETS = {
|
|
18
58
|
sm: { padding: "0.125rem 0.375rem", fontSize: "0.75rem" },
|
|
@@ -21,7 +61,7 @@ const SIZE_PRESETS = {
|
|
|
21
61
|
};
|
|
22
62
|
// Helper to get Radix colors based on color mode
|
|
23
63
|
const getRadixColor = (colorName, step, alpha = false) => {
|
|
24
|
-
const isDark = getColorMode() === "dark";
|
|
64
|
+
const isDark = (0, exports.getColorMode)() === "dark";
|
|
25
65
|
const colorKey = isDark ? `${colorName}Dark` : colorName;
|
|
26
66
|
const alphaKey = alpha ? "A" : "";
|
|
27
67
|
const colorScale = colors[`${colorKey}${alphaKey}`];
|
|
@@ -104,8 +144,8 @@ const generateDefaultStyleFromColor = (colorScheme) => {
|
|
|
104
144
|
}
|
|
105
145
|
else {
|
|
106
146
|
// Use custom hex color
|
|
107
|
-
const baseColor =
|
|
108
|
-
const isDark = getColorMode() === "dark";
|
|
147
|
+
const baseColor = (0, tinycolor2_1.default)(colorScheme);
|
|
148
|
+
const isDark = (0, exports.getColorMode)() === "dark";
|
|
109
149
|
return {
|
|
110
150
|
container: {
|
|
111
151
|
backgroundColor: isDark
|
|
@@ -128,7 +168,7 @@ const generateDefaultStyleFromColor = (colorScheme) => {
|
|
|
128
168
|
}
|
|
129
169
|
};
|
|
130
170
|
// Main style generation function - much simpler!
|
|
131
|
-
|
|
171
|
+
const generateTagStyle = (config = {}) => {
|
|
132
172
|
let baseStyle = { ...DEFAULT_STYLE };
|
|
133
173
|
// If a color scheme is provided, generate default colors from it
|
|
134
174
|
if (config.colorScheme) {
|
|
@@ -162,14 +202,16 @@ export const generateTagStyle = (config = {}) => {
|
|
|
162
202
|
};
|
|
163
203
|
return style;
|
|
164
204
|
};
|
|
205
|
+
exports.generateTagStyle = generateTagStyle;
|
|
165
206
|
// Helper to create tag with style
|
|
166
|
-
|
|
207
|
+
const createStyledTag = (id, title, styleConfig) => ({
|
|
167
208
|
id,
|
|
168
209
|
title,
|
|
169
210
|
style: styleConfig,
|
|
170
211
|
});
|
|
212
|
+
exports.createStyledTag = createStyledTag;
|
|
171
213
|
// Preset color schemes using Radix colors
|
|
172
|
-
|
|
214
|
+
exports.COLOR_PRESETS = {
|
|
173
215
|
primary: "blue",
|
|
174
216
|
success: "green",
|
|
175
217
|
warning: "amber",
|
|
@@ -178,7 +220,7 @@ export const COLOR_PRESETS = {
|
|
|
178
220
|
neutral: "gray",
|
|
179
221
|
};
|
|
180
222
|
// Example preset styles that developers can use or override
|
|
181
|
-
|
|
223
|
+
exports.TAG_STYLE_PRESETS = {
|
|
182
224
|
default: {
|
|
183
225
|
borderRadius: "999px",
|
|
184
226
|
padding: "0.235rem 0.588rem",
|
|
@@ -202,15 +244,16 @@ export const TAG_STYLE_PRESETS = {
|
|
|
202
244
|
},
|
|
203
245
|
};
|
|
204
246
|
// Utility class for managing tag themes (simplified)
|
|
205
|
-
|
|
247
|
+
class TagTheme {
|
|
206
248
|
constructor(defaultStyle = {}) {
|
|
207
249
|
this.defaultStyle = defaultStyle;
|
|
208
250
|
}
|
|
209
251
|
generateStyle(overrides) {
|
|
210
|
-
return generateTagStyle({ ...this.defaultStyle, ...overrides });
|
|
252
|
+
return (0, exports.generateTagStyle)({ ...this.defaultStyle, ...overrides });
|
|
211
253
|
}
|
|
212
254
|
// Create a tag with the theme's default style
|
|
213
255
|
createTag(id, title, overrides) {
|
|
214
|
-
return createStyledTag(id, title, { ...this.defaultStyle, ...overrides });
|
|
256
|
+
return (0, exports.createStyledTag)(id, title, { ...this.defaultStyle, ...overrides });
|
|
215
257
|
}
|
|
216
258
|
}
|
|
259
|
+
exports.TagTheme = TagTheme;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useAdaptiveLayoutState = void 0;
|
|
4
|
+
const vue_1 = require("vue");
|
|
2
5
|
const layoutStates = new Map();
|
|
3
|
-
|
|
6
|
+
const useAdaptiveLayoutState = (key = Symbol()) => {
|
|
4
7
|
if (!layoutStates.has(key)) {
|
|
5
|
-
const views = ref([]);
|
|
6
|
-
const initialized = ref(false);
|
|
7
|
-
const monitor = shallowRef(null);
|
|
8
|
-
const offScreenViewsLeading = computed(() => views.value.filter((view) => view.location === "leading"));
|
|
9
|
-
const offScreenViewsTrailing = computed(() => views.value.filter((view) => view.location === "trailing"));
|
|
10
|
-
const onScreenViews = computed(() => views.value.filter((view) => view.location === "onscreen"));
|
|
11
|
-
const overlayViews = computed(() => views.value.filter((view) => view.location === "overlay"));
|
|
12
|
-
const methods = reactive({
|
|
8
|
+
const views = (0, vue_1.ref)([]);
|
|
9
|
+
const initialized = (0, vue_1.ref)(false);
|
|
10
|
+
const monitor = (0, vue_1.shallowRef)(null);
|
|
11
|
+
const offScreenViewsLeading = (0, vue_1.computed)(() => views.value.filter((view) => view.location === "leading"));
|
|
12
|
+
const offScreenViewsTrailing = (0, vue_1.computed)(() => views.value.filter((view) => view.location === "trailing"));
|
|
13
|
+
const onScreenViews = (0, vue_1.computed)(() => views.value.filter((view) => view.location === "onscreen"));
|
|
14
|
+
const overlayViews = (0, vue_1.computed)(() => views.value.filter((view) => view.location === "overlay"));
|
|
15
|
+
const methods = (0, vue_1.reactive)({
|
|
13
16
|
add: () => console.warn("Layout not initialized"),
|
|
14
17
|
remove: () => console.warn("Layout not initialized"),
|
|
15
18
|
replace: () => console.warn("Layout not initialized"),
|
|
@@ -38,3 +41,4 @@ export const useAdaptiveLayoutState = (key = Symbol()) => {
|
|
|
38
41
|
}
|
|
39
42
|
return layoutStates.get(key);
|
|
40
43
|
};
|
|
44
|
+
exports.useAdaptiveLayoutState = useAdaptiveLayoutState;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useBreakpoints = void 0;
|
|
4
|
+
const useBreakpoints = (views) => {
|
|
2
5
|
const setupForBreakpoint = (oldBreakpoint, currentBreakpoint) => {
|
|
3
6
|
switch (currentBreakpoint) {
|
|
4
7
|
case "mobile":
|
|
@@ -35,3 +38,4 @@ export const useBreakpoints = (views) => {
|
|
|
35
38
|
setupForBreakpoint,
|
|
36
39
|
};
|
|
37
40
|
};
|
|
41
|
+
exports.useBreakpoints = useBreakpoints;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.breakpoints = exports.useResponsiveContainer = exports.useContainerMonitor = exports.DEFAULT_BREAKPOINTS = void 0;
|
|
4
|
+
const vue_1 = require("vue");
|
|
2
5
|
// Default breakpoint configuration
|
|
3
|
-
|
|
6
|
+
exports.DEFAULT_BREAKPOINTS = {
|
|
4
7
|
mobile: { min: 0, max: 639 },
|
|
5
8
|
tablet: { min: 640, max: 1023 },
|
|
6
9
|
desktop: { min: 1024, max: Infinity },
|
|
7
10
|
};
|
|
11
|
+
exports.breakpoints = exports.DEFAULT_BREAKPOINTS;
|
|
8
12
|
// Utility function to find the current breakpoint
|
|
9
13
|
const findCurrentBreakpoint = (width, breakpoints) => {
|
|
10
14
|
for (const [name, range] of Object.entries(breakpoints)) {
|
|
@@ -15,15 +19,15 @@ const findCurrentBreakpoint = (width, breakpoints) => {
|
|
|
15
19
|
return null;
|
|
16
20
|
};
|
|
17
21
|
// Main composable
|
|
18
|
-
|
|
19
|
-
const { breakpoints = DEFAULT_BREAKPOINTS, debounceMs = 16, // ~60fps
|
|
22
|
+
const useContainerMonitor = (elementRef, options = {}) => {
|
|
23
|
+
const { breakpoints = exports.DEFAULT_BREAKPOINTS, debounceMs = 16, // ~60fps
|
|
20
24
|
} = options;
|
|
21
25
|
// Reactive state
|
|
22
|
-
const dimensions = ref({ width: 0, height: 0 });
|
|
23
|
-
const currentBreakpoint = ref(null);
|
|
24
|
-
const previousBreakpoint = ref(null);
|
|
26
|
+
const dimensions = (0, vue_1.ref)({ width: 0, height: 0 });
|
|
27
|
+
const currentBreakpoint = (0, vue_1.ref)(null);
|
|
28
|
+
const previousBreakpoint = (0, vue_1.ref)(null);
|
|
25
29
|
// Computed properties for easy breakpoint checking
|
|
26
|
-
const breakpointQueries = computed(() => {
|
|
30
|
+
const breakpointQueries = (0, vue_1.computed)(() => {
|
|
27
31
|
const queries = {};
|
|
28
32
|
Object.keys(breakpoints).forEach((name) => {
|
|
29
33
|
queries[`is${name.charAt(0).toUpperCase() + name.slice(1)}`] =
|
|
@@ -105,10 +109,10 @@ export const useContainerMonitor = (elementRef, options = {}) => {
|
|
|
105
109
|
}
|
|
106
110
|
};
|
|
107
111
|
// Lifecycle hooks
|
|
108
|
-
onMounted(() => {
|
|
112
|
+
(0, vue_1.onMounted)(() => {
|
|
109
113
|
startObserver();
|
|
110
114
|
});
|
|
111
|
-
onUnmounted(() => {
|
|
115
|
+
(0, vue_1.onUnmounted)(() => {
|
|
112
116
|
stopObserver();
|
|
113
117
|
});
|
|
114
118
|
// Watch for element ref changes
|
|
@@ -134,12 +138,12 @@ export const useContainerMonitor = (elementRef, options = {}) => {
|
|
|
134
138
|
breakpoints,
|
|
135
139
|
};
|
|
136
140
|
};
|
|
141
|
+
exports.useContainerMonitor = useContainerMonitor;
|
|
137
142
|
// Convenience composable for common use cases
|
|
138
|
-
|
|
143
|
+
const useResponsiveContainer = (elementRef, customBreakpoints) => {
|
|
139
144
|
const breakpoints = customBreakpoints
|
|
140
|
-
? { ...DEFAULT_BREAKPOINTS, ...customBreakpoints }
|
|
141
|
-
: DEFAULT_BREAKPOINTS;
|
|
142
|
-
return useContainerMonitor(elementRef, { breakpoints });
|
|
145
|
+
? { ...exports.DEFAULT_BREAKPOINTS, ...customBreakpoints }
|
|
146
|
+
: exports.DEFAULT_BREAKPOINTS;
|
|
147
|
+
return (0, exports.useContainerMonitor)(elementRef, { breakpoints });
|
|
143
148
|
};
|
|
144
|
-
|
|
145
|
-
export { DEFAULT_BREAKPOINTS as breakpoints };
|
|
149
|
+
exports.useResponsiveContainer = useResponsiveContainer;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useViewAnimation = void 0;
|
|
7
|
+
const vue_1 = require("vue");
|
|
8
|
+
const Flip_1 = require("gsap/Flip");
|
|
9
|
+
const gsap_1 = __importDefault(require("gsap"));
|
|
10
|
+
gsap_1.default.registerPlugin(Flip_1.Flip);
|
|
11
|
+
const animationInProgress = (0, vue_1.ref)(false);
|
|
6
12
|
/*
|
|
7
13
|
# FLIP Order of Operations
|
|
8
14
|
Step 1: Get State
|
|
@@ -10,7 +16,7 @@ Step 3: Manipulate DOM
|
|
|
10
16
|
Step 4: Animate
|
|
11
17
|
Step 5: Update Data (vue reactive state)
|
|
12
18
|
*/
|
|
13
|
-
|
|
19
|
+
const useViewAnimation = (views, instanceKey, containerDimensions, padding, gap) => {
|
|
14
20
|
/*
|
|
15
21
|
* Basic animation function
|
|
16
22
|
*/
|
|
@@ -21,11 +27,11 @@ export const useViewAnimation = (views, instanceKey, containerDimensions, paddin
|
|
|
21
27
|
}
|
|
22
28
|
animationInProgress.value = true;
|
|
23
29
|
// Step 1: Get State
|
|
24
|
-
const state = Flip.getState(targets);
|
|
30
|
+
const state = Flip_1.Flip.getState(targets);
|
|
25
31
|
// Step 2: Manipulate DOM
|
|
26
32
|
manipulateDOMFn();
|
|
27
33
|
// Step 3: Animate
|
|
28
|
-
return Flip.from(state, {
|
|
34
|
+
return Flip_1.Flip.from(state, {
|
|
29
35
|
duration: 0.3,
|
|
30
36
|
ease: "power1.inOut",
|
|
31
37
|
absolute: true,
|
|
@@ -361,7 +367,7 @@ export const useViewAnimation = (views, instanceKey, containerDimensions, paddin
|
|
|
361
367
|
view.location = "overlay";
|
|
362
368
|
}
|
|
363
369
|
}
|
|
364
|
-
await nextTick();
|
|
370
|
+
await (0, vue_1.nextTick)();
|
|
365
371
|
const overlay = document.getElementById(getOverlayId());
|
|
366
372
|
if (!overlay)
|
|
367
373
|
return;
|
|
@@ -562,7 +568,7 @@ export const useViewAnimation = (views, instanceKey, containerDimensions, paddin
|
|
|
562
568
|
/*
|
|
563
569
|
State
|
|
564
570
|
*/
|
|
565
|
-
const isOverlayOpen = ref(false);
|
|
571
|
+
const isOverlayOpen = (0, vue_1.ref)(false);
|
|
566
572
|
return {
|
|
567
573
|
splitViewShow,
|
|
568
574
|
splitViewHide,
|
|
@@ -589,3 +595,4 @@ export const useViewAnimation = (views, instanceKey, containerDimensions, paddin
|
|
|
589
595
|
getSingleViewAfter,
|
|
590
596
|
};
|
|
591
597
|
};
|
|
598
|
+
exports.useViewAnimation = useViewAnimation;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useViewResize = void 0;
|
|
1
4
|
// useViewResize.ts
|
|
2
|
-
|
|
3
|
-
|
|
5
|
+
const vue_1 = require("vue");
|
|
6
|
+
const useViewResize = (onScreenViews, config, props, getViewId, // Changed from (index: number) => string
|
|
4
7
|
getOnscreenId) => {
|
|
5
|
-
const resizing = ref(null);
|
|
6
|
-
const resizeTooltip = ref({
|
|
8
|
+
const resizing = (0, vue_1.ref)(null);
|
|
9
|
+
const resizeTooltip = (0, vue_1.ref)({
|
|
7
10
|
visible: false,
|
|
8
11
|
x: 0,
|
|
9
12
|
y: 0,
|
|
@@ -119,7 +122,7 @@ getOnscreenId) => {
|
|
|
119
122
|
resizeTooltip.value.visible = false;
|
|
120
123
|
};
|
|
121
124
|
// Set up event listeners when resizing starts/ends
|
|
122
|
-
watch(resizing, (newVal) => {
|
|
125
|
+
(0, vue_1.watch)(resizing, (newVal) => {
|
|
123
126
|
if (newVal) {
|
|
124
127
|
document.addEventListener("mousemove", handleMouseResize);
|
|
125
128
|
document.addEventListener("mouseup", endResize);
|
|
@@ -134,7 +137,7 @@ getOnscreenId) => {
|
|
|
134
137
|
document.removeEventListener("mousemove", handleMouseResize);
|
|
135
138
|
document.removeEventListener("mouseup", endResize);
|
|
136
139
|
};
|
|
137
|
-
onUnmounted(() => {
|
|
140
|
+
(0, vue_1.onUnmounted)(() => {
|
|
138
141
|
cleanup();
|
|
139
142
|
});
|
|
140
143
|
return {
|
|
@@ -144,3 +147,4 @@ getOnscreenId) => {
|
|
|
144
147
|
updateViewWidth,
|
|
145
148
|
};
|
|
146
149
|
};
|
|
150
|
+
exports.useViewResize = useViewResize;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useNavigationStack = useNavigationStack;
|
|
4
|
+
const vue_1 = require("vue");
|
|
5
|
+
const gsap_1 = require("gsap");
|
|
6
|
+
const Flip_1 = require("gsap/Flip");
|
|
7
|
+
gsap_1.gsap.registerPlugin(Flip_1.Flip);
|
|
8
|
+
function useNavigationStack(initialPanes, taskKey) {
|
|
9
|
+
const panes = (0, vue_1.ref)(initialPanes);
|
|
10
|
+
const currentIndex = (0, vue_1.ref)(0);
|
|
11
|
+
const visiblePanes = (0, vue_1.computed)(() => panes.value.map((_, index) => index === currentIndex.value));
|
|
9
12
|
const navigate = (index, animated = true) => {
|
|
10
13
|
// Ensure index is within bounds
|
|
11
14
|
if (index < 0 || index >= panes.value.length) {
|
|
@@ -40,7 +43,7 @@ export function useNavigationStack(initialPanes, taskKey) {
|
|
|
40
43
|
if (!animated) {
|
|
41
44
|
states = [];
|
|
42
45
|
}
|
|
43
|
-
const state = Flip.getState(states);
|
|
46
|
+
const state = Flip_1.Flip.getState(states);
|
|
44
47
|
// Reorganize panes
|
|
45
48
|
for (let i = 0; i < panes.value.length; i++) {
|
|
46
49
|
const pane = document.getElementById(`${taskKey}-pane-${i}`);
|
|
@@ -60,7 +63,7 @@ export function useNavigationStack(initialPanes, taskKey) {
|
|
|
60
63
|
}
|
|
61
64
|
}
|
|
62
65
|
currentIndex.value = index;
|
|
63
|
-
Flip.from(state, {
|
|
66
|
+
Flip_1.Flip.from(state, {
|
|
64
67
|
duration: 0.3,
|
|
65
68
|
ease: "power1.inOut",
|
|
66
69
|
absolute: true,
|