orio-ui 1.20.0 → 1.23.2
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/README.md +12 -5
- package/dist/module.json +1 -1
- package/dist/module.mjs +5 -2
- package/dist/runtime/canvas.d.ts +21 -0
- package/dist/runtime/canvas.js +49 -0
- package/dist/runtime/components/Canvas/REQUIREMENTS.md +174 -0
- package/dist/runtime/components/Canvas/components/Stage.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/components/Stage.vue +150 -0
- package/dist/runtime/components/Canvas/components/Stage.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/components/ToolButton.d.vue.ts +24 -0
- package/dist/runtime/components/Canvas/components/ToolButton.vue +62 -0
- package/dist/runtime/components/Canvas/components/ToolButton.vue.d.ts +24 -0
- package/dist/runtime/components/Canvas/components/Toolbar.d.vue.ts +24 -0
- package/dist/runtime/components/Canvas/components/Toolbar.vue +48 -0
- package/dist/runtime/components/Canvas/components/Toolbar.vue.d.ts +24 -0
- package/dist/runtime/components/Canvas/composables/useCanvasHistory.d.ts +17 -0
- package/dist/runtime/components/Canvas/composables/useCanvasHistory.js +76 -0
- package/dist/runtime/components/Canvas/composables/useCanvasNodes.d.ts +13 -0
- package/dist/runtime/components/Canvas/composables/useCanvasNodes.js +60 -0
- package/dist/runtime/components/Canvas/composables/useCanvasSetup.d.ts +5 -0
- package/dist/runtime/components/Canvas/composables/useCanvasSetup.js +19 -0
- package/dist/runtime/components/Canvas/context.d.ts +38 -0
- package/dist/runtime/components/Canvas/context.js +11 -0
- package/dist/runtime/components/Canvas/index.d.vue.ts +77 -0
- package/dist/runtime/components/Canvas/index.vue +208 -0
- package/dist/runtime/components/Canvas/index.vue.d.ts +77 -0
- package/dist/runtime/components/Canvas/registry.d.ts +1 -0
- package/dist/runtime/components/Canvas/registry.js +2 -0
- package/dist/runtime/components/Canvas/tools/ColorPickerWidget.d.vue.ts +7 -0
- package/dist/runtime/components/Canvas/tools/ColorPickerWidget.vue +32 -0
- package/dist/runtime/components/Canvas/tools/ColorPickerWidget.vue.d.ts +7 -0
- package/dist/runtime/components/Canvas/tools/clearTool.d.ts +1 -0
- package/dist/runtime/components/Canvas/tools/clearTool.js +16 -0
- package/dist/runtime/components/Canvas/tools/colorPickerTool.d.ts +6 -0
- package/dist/runtime/components/Canvas/tools/colorPickerTool.js +15 -0
- package/dist/runtime/components/Canvas/tools/drawTool.d.ts +16 -0
- package/dist/runtime/components/Canvas/tools/drawTool.js +92 -0
- package/dist/runtime/components/Canvas/tools/eraseTool.d.ts +5 -0
- package/dist/runtime/components/Canvas/tools/eraseTool.js +62 -0
- package/dist/runtime/components/Canvas/tools/exportTool.d.ts +18 -0
- package/dist/runtime/components/Canvas/tools/exportTool.js +89 -0
- package/dist/runtime/components/Canvas/tools/highlightTool.d.ts +11 -0
- package/dist/runtime/components/Canvas/tools/highlightTool.js +51 -0
- package/dist/runtime/components/Canvas/tools/hitTest.d.ts +20 -0
- package/dist/runtime/components/Canvas/tools/hitTest.js +111 -0
- package/dist/runtime/components/Canvas/tools/imageTool.d.ts +18 -0
- package/dist/runtime/components/Canvas/tools/imageTool.js +163 -0
- package/dist/runtime/components/Canvas/tools/moveTool.d.ts +5 -0
- package/dist/runtime/components/Canvas/tools/moveTool.js +94 -0
- package/dist/runtime/components/Canvas/tools/redoTool.d.ts +1 -0
- package/dist/runtime/components/Canvas/tools/redoTool.js +17 -0
- package/dist/runtime/components/Canvas/tools/resizeTool.d.ts +7 -0
- package/dist/runtime/components/Canvas/tools/resizeTool.js +132 -0
- package/dist/runtime/components/Canvas/tools/rotateTool.d.ts +5 -0
- package/dist/runtime/components/Canvas/tools/rotateTool.js +109 -0
- package/dist/runtime/components/Canvas/tools/textTool.d.ts +14 -0
- package/dist/runtime/components/Canvas/tools/textTool.js +99 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Clear.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Clear.vue +12 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Clear.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Draw.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Draw.vue +12 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Draw.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Erase.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Erase.vue +12 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Erase.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Export.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Export.vue +13 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Export.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Highlight.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Highlight.vue +12 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Highlight.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Image.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Image.vue +13 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Image.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Move.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Move.vue +13 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Move.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Redo.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Redo.vue +13 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Redo.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Resize.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Resize.vue +13 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Resize.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Rotate.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Rotate.vue +13 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Rotate.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Text.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Text.vue +13 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Text.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Transform.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Transform.vue +14 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Transform.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Undo.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Undo.vue +13 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Undo.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/transformHandles.d.ts +74 -0
- package/dist/runtime/components/Canvas/tools/transformHandles.js +191 -0
- package/dist/runtime/components/Canvas/tools/transformTool.d.ts +7 -0
- package/dist/runtime/components/Canvas/tools/transformTool.js +210 -0
- package/dist/runtime/components/Canvas/tools/undoTool.d.ts +1 -0
- package/dist/runtime/components/Canvas/tools/undoTool.js +17 -0
- package/dist/runtime/components/Canvas/types.d.ts +125 -0
- package/dist/runtime/components/Canvas/types.js +3 -0
- package/dist/runtime/components/ControlElement.vue +5 -1
- package/dist/runtime/components/DateRangePicker.vue +16 -4
- package/dist/runtime/components/Icon.vue +2 -2
- package/dist/runtime/components/LocaleSwitcher.d.vue.ts +13 -0
- package/dist/runtime/components/LocaleSwitcher.vue +43 -0
- package/dist/runtime/components/LocaleSwitcher.vue.d.ts +13 -0
- package/dist/runtime/components/Selector.vue +14 -5
- package/dist/runtime/components/Tooltip.vue +17 -7
- package/dist/runtime/components/ZoomableContainer.d.vue.ts +48 -0
- package/dist/runtime/components/ZoomableContainer.vue +238 -0
- package/dist/runtime/components/ZoomableContainer.vue.d.ts +48 -0
- package/dist/runtime/components/gallery/Carousel.vue +1 -1
- package/dist/runtime/components/gallery/CarouselPreview.d.vue.ts +31 -0
- package/dist/runtime/components/gallery/CarouselPreview.vue +64 -0
- package/dist/runtime/components/gallery/CarouselPreview.vue.d.ts +31 -0
- package/dist/runtime/components/view/Dates.vue +5 -3
- package/dist/runtime/components/view/KeyBinds.d.vue.ts +7 -0
- package/dist/runtime/components/view/KeyBinds.vue +36 -0
- package/dist/runtime/components/view/KeyBinds.vue.d.ts +7 -0
- package/dist/runtime/components/view/Text.vue +4 -4
- package/dist/runtime/composables/useInertia.d.ts +10 -0
- package/dist/runtime/composables/useInertia.js +49 -0
- package/dist/runtime/composables/usePinchZoom.d.ts +13 -0
- package/dist/runtime/composables/usePinchZoom.js +66 -0
- package/dist/runtime/composables/useValidation.js +11 -1
- package/dist/runtime/i18n/en.json +20 -0
- package/dist/runtime/i18n/index.d.ts +11 -0
- package/dist/runtime/i18n/index.js +19 -0
- package/dist/runtime/i18n/uk.json +20 -0
- package/dist/runtime/index.d.ts +5 -0
- package/dist/runtime/index.js +16 -0
- package/dist/runtime/plugins/i18n.d.ts +2 -0
- package/dist/runtime/plugins/i18n.js +18 -0
- package/dist/runtime/utils/icon-registry.js +13 -1
- package/package.json +9 -4
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export function usePinchZoom(callbacks) {
|
|
2
|
+
const pointers = /* @__PURE__ */ new Map();
|
|
3
|
+
let startDist = 0;
|
|
4
|
+
let lastMid = { x: 0, y: 0 };
|
|
5
|
+
function distance() {
|
|
6
|
+
const pts = [...pointers.values()];
|
|
7
|
+
if (pts.length < 2) return 0;
|
|
8
|
+
return Math.hypot(pts[1].x - pts[0].x, pts[1].y - pts[0].y);
|
|
9
|
+
}
|
|
10
|
+
function midpoint() {
|
|
11
|
+
const pts = [...pointers.values()];
|
|
12
|
+
if (pts.length < 2) return { x: 0, y: 0 };
|
|
13
|
+
return {
|
|
14
|
+
x: (pts[0].x + pts[1].x) / 2,
|
|
15
|
+
y: (pts[0].y + pts[1].y) / 2
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function onPointerDown(e) {
|
|
19
|
+
if (e.pointerType !== "touch") return false;
|
|
20
|
+
if (pointers.size >= 2) return false;
|
|
21
|
+
pointers.set(e.pointerId, { x: e.clientX, y: e.clientY });
|
|
22
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
23
|
+
if (pointers.size === 2) {
|
|
24
|
+
startDist = distance();
|
|
25
|
+
lastMid = midpoint();
|
|
26
|
+
callbacks.onPinchStart?.();
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
if (pointers.size === 1) {
|
|
30
|
+
callbacks.onSingleDown?.(e);
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
function onPointerMove(e) {
|
|
36
|
+
if (!pointers.has(e.pointerId)) return false;
|
|
37
|
+
pointers.set(e.pointerId, { x: e.clientX, y: e.clientY });
|
|
38
|
+
if (pointers.size === 2) {
|
|
39
|
+
const dist = distance();
|
|
40
|
+
const mid = midpoint();
|
|
41
|
+
const scaleFactor = startDist > 0 ? dist / startDist : 1;
|
|
42
|
+
const dx = mid.x - lastMid.x;
|
|
43
|
+
const dy = mid.y - lastMid.y;
|
|
44
|
+
lastMid = mid;
|
|
45
|
+
callbacks.onPinchMove?.(scaleFactor, mid.x, mid.y, dx, dy);
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
function onPointerUp(e) {
|
|
51
|
+
if (!pointers.has(e.pointerId)) return false;
|
|
52
|
+
pointers.delete(e.pointerId);
|
|
53
|
+
if (pointers.size === 1) {
|
|
54
|
+
const [id, pt] = [...pointers.entries()][0];
|
|
55
|
+
startDist = 0;
|
|
56
|
+
callbacks.onSingleUp?.(id, pt.x, pt.y);
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
if (pointers.size === 0) {
|
|
60
|
+
startDist = 0;
|
|
61
|
+
callbacks.onAllUp?.();
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
return { onPointerDown, onPointerMove, onPointerUp, pointers };
|
|
66
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { reactive, ref, unref } from "vue";
|
|
2
|
+
import { useI18n } from "vue-i18n";
|
|
3
|
+
import en from "../i18n/en.json";
|
|
2
4
|
export function isFilled(value) {
|
|
3
5
|
return !!value.length;
|
|
4
6
|
}
|
|
@@ -7,7 +9,15 @@ export function isEmail(value) {
|
|
|
7
9
|
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
8
10
|
return emailRegex.test(value);
|
|
9
11
|
}
|
|
12
|
+
function getT() {
|
|
13
|
+
try {
|
|
14
|
+
return useI18n().t;
|
|
15
|
+
} catch {
|
|
16
|
+
return (key) => key.split(".").reduce((o, k) => o?.[k], en) ?? key;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
10
19
|
export function useValidation(rules) {
|
|
20
|
+
const t = getT();
|
|
11
21
|
const validationRules = ref(rules ?? []);
|
|
12
22
|
const errors = reactive({});
|
|
13
23
|
function validate({
|
|
@@ -18,7 +28,7 @@ export function useValidation(rules) {
|
|
|
18
28
|
}) {
|
|
19
29
|
if (!validator(unref(model))) {
|
|
20
30
|
if (!errors[id]) {
|
|
21
|
-
errors[id] = message || "
|
|
31
|
+
errors[id] = message || t("validation.fieldError");
|
|
22
32
|
}
|
|
23
33
|
document.getElementById(id)?.scrollIntoView({
|
|
24
34
|
behavior: "smooth",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"selector": {
|
|
3
|
+
"placeholder": "Select an option",
|
|
4
|
+
"selected": "{count} selected",
|
|
5
|
+
"noOptions": "No options found"
|
|
6
|
+
},
|
|
7
|
+
"dateRangePicker": {
|
|
8
|
+
"startBeforeEnd": "Start date must be before end date.",
|
|
9
|
+
"present": "Present"
|
|
10
|
+
},
|
|
11
|
+
"dates": {
|
|
12
|
+
"present": "Present"
|
|
13
|
+
},
|
|
14
|
+
"validation": {
|
|
15
|
+
"fieldError": "Error on this field"
|
|
16
|
+
},
|
|
17
|
+
"canvas": {
|
|
18
|
+
"toolbarLabel": "Canvas toolbar"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import en from "./en.json.js";
|
|
2
|
+
import uk from "./uk.json.js";
|
|
3
|
+
export type LocaleMessages = Record<string, string | LocaleMessages>;
|
|
4
|
+
export declare const i18n: import("vue-i18n").I18n<{
|
|
5
|
+
en: any;
|
|
6
|
+
uk: any;
|
|
7
|
+
}, {}, {}, string, false>;
|
|
8
|
+
export declare function addLocale(code: string, messages: LocaleMessages): void;
|
|
9
|
+
export declare function mergeLocale(code: string, messages: LocaleMessages): void;
|
|
10
|
+
export declare function setLocale(code: string): void;
|
|
11
|
+
export { en, uk };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createI18n } from "vue-i18n";
|
|
2
|
+
import en from "./en.json";
|
|
3
|
+
import uk from "./uk.json";
|
|
4
|
+
export const i18n = createI18n({
|
|
5
|
+
legacy: false,
|
|
6
|
+
locale: "en",
|
|
7
|
+
fallbackLocale: "en",
|
|
8
|
+
messages: { en, uk }
|
|
9
|
+
});
|
|
10
|
+
export function addLocale(code, messages) {
|
|
11
|
+
i18n.global.setLocaleMessage(code, messages);
|
|
12
|
+
}
|
|
13
|
+
export function mergeLocale(code, messages) {
|
|
14
|
+
i18n.global.mergeLocaleMessage(code, messages);
|
|
15
|
+
}
|
|
16
|
+
export function setLocale(code) {
|
|
17
|
+
i18n.global.locale.value = code;
|
|
18
|
+
}
|
|
19
|
+
export { en, uk };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"selector": {
|
|
3
|
+
"placeholder": "Оберіть опцію",
|
|
4
|
+
"selected": "{count} обрано",
|
|
5
|
+
"noOptions": "Опцій не знайдено"
|
|
6
|
+
},
|
|
7
|
+
"dateRangePicker": {
|
|
8
|
+
"startBeforeEnd": "Дата початку має бути раніше дати завершення.",
|
|
9
|
+
"present": "Теперішній час"
|
|
10
|
+
},
|
|
11
|
+
"dates": {
|
|
12
|
+
"present": "Теперішній час"
|
|
13
|
+
},
|
|
14
|
+
"validation": {
|
|
15
|
+
"fieldError": "Помилка в цьому полі"
|
|
16
|
+
},
|
|
17
|
+
"canvas": {
|
|
18
|
+
"toolbarLabel": "Панель інструментів полотна"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -24,14 +24,18 @@ export { default as Modal } from "./components/Modal.vue.js";
|
|
|
24
24
|
export { default as Popover } from "./components/Popover.vue.js";
|
|
25
25
|
export { default as Tooltip } from "./components/Tooltip.vue.js";
|
|
26
26
|
export { default as Upload } from "./components/upload/index.vue.js";
|
|
27
|
+
export * from "./canvas.js";
|
|
27
28
|
export { default as EmptyState } from "./components/EmptyState.vue.js";
|
|
28
29
|
export { default as DashedContainer } from "./components/DashedContainer.vue.js";
|
|
29
30
|
export { default as ControlElement } from "./components/ControlElement.vue.js";
|
|
30
31
|
export { default as GalleryCarousel } from "./components/gallery/Carousel.vue.js";
|
|
32
|
+
export { default as GalleryCarouselPreview } from "./components/gallery/CarouselPreview.vue.js";
|
|
31
33
|
export { default as ViewText } from "./components/view/Text.vue.js";
|
|
34
|
+
export { default as ViewKeyBinds, type KeyBindsProps, } from "./components/view/KeyBinds.vue.js";
|
|
32
35
|
export { default as ViewDates } from "./components/view/Dates.vue.js";
|
|
33
36
|
export { default as ViewSeparator } from "./components/view/Separator.vue.js";
|
|
34
37
|
export { default as ListItem } from "./components/ListItem.vue.js";
|
|
38
|
+
export { default as LocaleSwitcher, type LocaleOption, } from "./components/LocaleSwitcher.vue.js";
|
|
35
39
|
export { useApi, type ApiOptions, type RequestBody, type RequestMethod, } from "./composables/useApi.js";
|
|
36
40
|
export { useFuzzySearch } from "./composables/useFuzzySearch.js";
|
|
37
41
|
export { useModal, type ModalProps, type OriginRect, } from "./composables/useModal.js";
|
|
@@ -43,3 +47,4 @@ export { useValidation, isFilled, isEmail, type ValidationRule, } from "./compos
|
|
|
43
47
|
export { iconRegistry, type IconName } from "./utils/icon-registry.js";
|
|
44
48
|
export { flattenParams, unflattenParams, parsePath, topLevelKeys, } from "./utils/urlParams.js";
|
|
45
49
|
export { useUrlSync } from "./composables/useUrlSync.js";
|
|
50
|
+
export { i18n, en, uk, addLocale, mergeLocale, setLocale, type LocaleMessages, } from "./i18n/index.js";
|
package/dist/runtime/index.js
CHANGED
|
@@ -28,14 +28,22 @@ export { default as Modal } from "./components/Modal.vue";
|
|
|
28
28
|
export { default as Popover } from "./components/Popover.vue";
|
|
29
29
|
export { default as Tooltip } from "./components/Tooltip.vue";
|
|
30
30
|
export { default as Upload } from "./components/upload/index.vue";
|
|
31
|
+
export * from "./canvas.js";
|
|
31
32
|
export { default as EmptyState } from "./components/EmptyState.vue";
|
|
32
33
|
export { default as DashedContainer } from "./components/DashedContainer.vue";
|
|
33
34
|
export { default as ControlElement } from "./components/ControlElement.vue";
|
|
34
35
|
export { default as GalleryCarousel } from "./components/gallery/Carousel.vue";
|
|
36
|
+
export { default as GalleryCarouselPreview } from "./components/gallery/CarouselPreview.vue";
|
|
35
37
|
export { default as ViewText } from "./components/view/Text.vue";
|
|
38
|
+
export {
|
|
39
|
+
default as ViewKeyBinds
|
|
40
|
+
} from "./components/view/KeyBinds.vue";
|
|
36
41
|
export { default as ViewDates } from "./components/view/Dates.vue";
|
|
37
42
|
export { default as ViewSeparator } from "./components/view/Separator.vue";
|
|
38
43
|
export { default as ListItem } from "./components/ListItem.vue";
|
|
44
|
+
export {
|
|
45
|
+
default as LocaleSwitcher
|
|
46
|
+
} from "./components/LocaleSwitcher.vue";
|
|
39
47
|
export {
|
|
40
48
|
useApi
|
|
41
49
|
} from "./composables/useApi.js";
|
|
@@ -60,3 +68,11 @@ export {
|
|
|
60
68
|
topLevelKeys
|
|
61
69
|
} from "./utils/urlParams.js";
|
|
62
70
|
export { useUrlSync } from "./composables/useUrlSync.js";
|
|
71
|
+
export {
|
|
72
|
+
i18n,
|
|
73
|
+
en,
|
|
74
|
+
uk,
|
|
75
|
+
addLocale,
|
|
76
|
+
mergeLocale,
|
|
77
|
+
setLocale
|
|
78
|
+
} from "./i18n/index.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineNuxtPlugin } from "#app";
|
|
2
|
+
import { createI18n } from "vue-i18n";
|
|
3
|
+
import en from "../i18n/en.json";
|
|
4
|
+
import uk from "../i18n/uk.json";
|
|
5
|
+
export default defineNuxtPlugin({
|
|
6
|
+
name: "orio-ui-i18n",
|
|
7
|
+
enforce: "pre",
|
|
8
|
+
setup(nuxtApp) {
|
|
9
|
+
const i18n = createI18n({
|
|
10
|
+
legacy: false,
|
|
11
|
+
locale: "en",
|
|
12
|
+
fallbackLocale: "en",
|
|
13
|
+
messages: { en, uk }
|
|
14
|
+
});
|
|
15
|
+
nuxtApp.vueApp.use(i18n);
|
|
16
|
+
nuxtApp.provide("orioI18n", i18n);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
@@ -132,5 +132,17 @@ export const iconRegistry = {
|
|
|
132
132
|
// More e-commerce actions
|
|
133
133
|
compare: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M10 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h5v2h2V1h-2zm0 15H5l5-6zm9-15h-5v2h5v13l-5-6v9h5c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"/></svg>`,
|
|
134
134
|
discount: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="m12.79 21l-.16-.16L2.38 10.59a2.04 2.04 0 0 1-.38-.62a2 2 0 0 1 0-1.54c.08-.23.2-.45.38-.62l1.67-1.67a2.04 2.04 0 0 1 .62-.38c.24-.09.49-.13.75-.13s.51.04.75.13c.23.08.44.2.62.38l1.26 1.25V3c0-.55.2-1.02.59-1.41C9.03 1.2 9.5 1 10.04 1h3.92c.54 0 1.01.2 1.41.59c.39.39.59.86.59 1.41v4.39l1.26-1.25c.18-.18.39-.3.62-.38c.24-.09.49-.13.75-.13s.51.04.75.13c.23.08.44.2.62.38l1.67 1.67c.18.17.3.38.38.62c.09.24.13.49.13.76c0 .26-.04.51-.13.75s-.2.45-.38.63L11.38 20.83l-.17.16c-.39.39-.86.59-1.41.59s-1.02-.2-1.41-.59zM14 8V3h-4v5zm-6.8 4.2c.26.26.57.39.93.39c.36 0 .67-.13.93-.39c.26-.26.39-.57.39-.93c0-.36-.13-.67-.39-.93a1.28 1.28 0 0 0-.93-.39c-.36 0-.67.13-.93.39c-.26.26-.39.57-.39.93c0 .36.13.67.39.93m9.6 4.6c.26.26.57.39.93.39c.36 0 .67-.13.93-.39c.26-.26.39-.57.39-.93c0-.36-.13-.67-.39-.93a1.28 1.28 0 0 0-.93-.39c-.36 0-.67.13-.93.39c-.26.26-.39.57-.39.93c0 .36.13.67.39.93m-8.4 1.1l9.5-9.5l-1.4-1.4l-9.5 9.5z"/></svg>`,
|
|
135
|
-
box: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5v-3h14zm0-5H5V5h14z"/></svg
|
|
135
|
+
box: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5v-3h14zm0-5H5V5h14z"/></svg>`,
|
|
136
|
+
// CANVAS / DRAWING
|
|
137
|
+
pencil: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04a1 1 0 0 0 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83l3.75 3.75z"/></svg>`,
|
|
138
|
+
text: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z"/></svg>`,
|
|
139
|
+
undo: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M12.5 8c-2.65 0-5.05 1.04-6.83 2.73L3 8v9h9l-2.83-2.83A7.95 7.95 0 0 1 12.5 12c3.04 0 5.64 1.71 6.96 4.21l1.77-.89A9.96 9.96 0 0 0 12.5 8"/></svg>`,
|
|
140
|
+
redo: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.16 0-7.74 2.42-9.44 5.93l1.77.89A7.96 7.96 0 0 1 11.5 12c2.13 0 4.07.74 5.62 1.98L14 17h9V8z"/></svg>`,
|
|
141
|
+
eraser: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M16.24 3.56l4.95 4.94c.78.79.78 2.05 0 2.84L12 20.53a4.01 4.01 0 0 1-2.83 1.17H4.59L2 19.12l4.83-4.83l-1.42-1.42l7.79-7.78l1.41-1.41l1.42-.12zm-1.42 4.24l-5.66 5.66l2.83 2.83l5.66-5.66z"/></svg>`,
|
|
142
|
+
move: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M13 6v5h5V8l4 4l-4 4v-3h-5v5h3l-4 4l-4-4h3v-5H6v3l-4-4l4-4v3h5V6H8l4-4l4 4z"/></svg>`,
|
|
143
|
+
highlight: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M3 3h18v2H3zm0 16h18v2H3zm0-8h18v2H3zm2-4v4h14V7zm0 8v4h14v-4z" opacity="0.5"/><rect x="5" y="7" width="14" height="4" rx="1" fill="none" stroke="currentColor" stroke-width="1.5"/><rect x="5" y="13" width="14" height="4" rx="1" fill="none" stroke="currentColor" stroke-width="1.5"/></svg>`,
|
|
144
|
+
rotate: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6s-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8s-3.58-8-8-8"/></svg>`,
|
|
145
|
+
resize: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M22 22H2V2h2v18h18zM6 6h4v2H8v2H6zm12 12h-4v-2h2v-2h2zM6 18v-4h2v2h2v2zm12-12v4h-2V8h-2V6z"/></svg>`,
|
|
146
|
+
transform: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-width="1.5" d="M5 5h14v14H5z"/><circle cx="5" cy="5" r="1.75" fill="currentColor"/><circle cx="19" cy="5" r="1.75" fill="currentColor"/><circle cx="5" cy="19" r="1.75" fill="currentColor"/><circle cx="19" cy="19" r="1.75" fill="currentColor"/><path fill="none" stroke="currentColor" stroke-width="1.5" d="M12 5V2"/><circle cx="12" cy="2" r="1.25" fill="currentColor"/></svg>`,
|
|
147
|
+
export: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"/></svg>`
|
|
136
148
|
};
|
package/package.json
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orio-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.23.2",
|
|
4
4
|
"description": "Modern Nuxt component library with theme support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/module.mjs",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"types": "./dist/
|
|
9
|
+
"types": "./dist/runtime/index.d.ts",
|
|
10
10
|
"import": "./dist/module.mjs"
|
|
11
11
|
},
|
|
12
12
|
"./runtime": {
|
|
13
13
|
"types": "./dist/runtime/index.d.ts",
|
|
14
|
-
"import": "./dist/runtime/index.
|
|
14
|
+
"import": "./dist/runtime/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./canvas": {
|
|
17
|
+
"types": "./dist/runtime/canvas.d.ts",
|
|
18
|
+
"import": "./dist/runtime/canvas.js"
|
|
15
19
|
},
|
|
16
20
|
"./styles": "./dist/runtime/assets/css/main.css",
|
|
17
21
|
"./theme": "./dist/runtime/assets/css/colors.css"
|
|
@@ -42,7 +46,8 @@
|
|
|
42
46
|
"change-case": "^5.4.4",
|
|
43
47
|
"fuse.js": "^7.0.0",
|
|
44
48
|
"ofetch": "^1.5.1",
|
|
45
|
-
"universal-cookie": "^7.0.0"
|
|
49
|
+
"universal-cookie": "^7.0.0",
|
|
50
|
+
"vue-i18n": "^11.3.1"
|
|
46
51
|
},
|
|
47
52
|
"devDependencies": {
|
|
48
53
|
"@eslint/js": "^9.39.2",
|