Skip to content

Commit 8b4a1f1

Browse files
authored
Merge pull request #69 from kimuraz/dev
v2.0.0
2 parents b2fe111 + 0b99b9d commit 8b4a1f1

34 files changed

+14577
-10236
lines changed

dist/composables/useDraggable.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { DraggableOptions } from '@interactjs/actions/drag/plugin';
2+
import { InteractContext } from './useInteractContext';
3+
export interface IPosition {
4+
x: number;
5+
y: number;
6+
}
7+
declare const useDraggable: (context: InteractContext, interactOptions?: DraggableOptions) => {
8+
init: () => void;
9+
position: import('vue').Ref<import('./useInteractContext').IPosition>;
10+
draggableOptions: import('vue').WritableComputedRef<DraggableOptions>;
11+
isDragging: import('vue').Ref<boolean>;
12+
};
13+
export default useDraggable;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Interactable } from '@interactjs/types';
2+
import { default as interact } from 'interactjs';
3+
import { Ref } from 'vue';
4+
export interface IPosition {
5+
x: number;
6+
y: number;
7+
}
8+
export interface ISizeData {
9+
width: number;
10+
height: number;
11+
}
12+
export interface InteractContext {
13+
interactable: Ref<Interactable | null>;
14+
interact: typeof interact;
15+
position: Ref<IPosition>;
16+
size: Ref<ISizeData>;
17+
}
18+
declare const useInteractContext: (elRef: Ref) => InteractContext;
19+
export default useInteractContext;

dist/composables/useResizable.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { ResizableOptions } from '@interactjs/actions/resize/plugin';
2+
import { InteractContext } from './useInteractContext';
3+
declare const useResizable: (context: InteractContext, interactOptions: ResizableOptions) => {
4+
init: () => void;
5+
resizeData: import('vue').Ref<import('./useInteractContext').ISizeData>;
6+
position: import('vue').Ref<import('./useInteractContext').IPosition>;
7+
resizableOptions: import('vue').WritableComputedRef<ResizableOptions>;
8+
isResizing: import('vue').Ref<boolean>;
9+
};
10+
export default useResizable;

dist/index.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Plugin } from 'vue';
2+
import { default as useInteractContext } from './composables/useInteractContext';
3+
import { default as useDraggable } from './composables/useDraggable';
4+
import { default as useResizable } from './composables/useResizable';
5+
export interface IVueInteractOptions {
6+
installInject?: boolean;
7+
installGlobalProperty?: boolean;
8+
}
9+
declare const VueInteract: Plugin;
10+
export { useInteractContext, useDraggable, useResizable };
11+
export default VueInteract;

dist/vue-interact.js

Lines changed: 2414 additions & 0 deletions
Large diffs are not rendered by default.

dist/vue-interact.min.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/vue-interact.umd.cjs

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

docs/.vuepress/client.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { defineClientConfig } from '@vuepress/client';
2+
import DemoUseDraggable from '../guide/composables/components/DemoUseDraggable.vue';
3+
import DemoUseResizable from '../guide/composables/components/DemoUseResizable.vue';
4+
import DemoUseDragAndResize from '../guide/composables/components/DemoUseDragAndResize.vue';
5+
6+
export default defineClientConfig({
7+
enhance({ app }) {
8+
app.component('DemoUseDraggable', DemoUseDraggable);
9+
app.component('DemoUseResizable', DemoUseResizable);
10+
app.component('DemoUseDragAndResize', DemoUseDragAndResize);
11+
},
12+
});

docs/.vuepress/config.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
import { defineUserConfig, defaultTheme } from "vuepress";
1+
import { defineUserConfig } from "vuepress";
2+
import { defaultTheme } from '@vuepress/theme-default';
3+
import { viteBundler } from '@vuepress/bundler-vite';
4+
import navbar from './navbar';
5+
import sidebar from './sidebar';
26

37
export default defineUserConfig({
48
lang: "en-US",
59
title: "VueInteract",
610
description: "VueInteract is a Vue 3 wrapper for Interact.js",
711
theme: defaultTheme({
8-
logo: '/assets/VueInteract.svg',
12+
navbar,
13+
sidebar,
14+
repo: 'https://github.com/kimuraz/vue-interact',
915
}),
16+
bundler: viteBundler(),
1017
});
1118

docs/.vuepress/navbar.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default [
2+
{ text: 'Home', link: '/' },
3+
{ text: 'Getting Started', link: '/guide/getting_started.html' },
4+
{ text: 'Composables', link: '/guide/composables/index.html' },
5+
];

0 commit comments

Comments
 (0)