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.
Files changed (139) hide show
  1. package/README.md +12 -5
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +5 -2
  4. package/dist/runtime/canvas.d.ts +21 -0
  5. package/dist/runtime/canvas.js +49 -0
  6. package/dist/runtime/components/Canvas/REQUIREMENTS.md +174 -0
  7. package/dist/runtime/components/Canvas/components/Stage.d.vue.ts +3 -0
  8. package/dist/runtime/components/Canvas/components/Stage.vue +150 -0
  9. package/dist/runtime/components/Canvas/components/Stage.vue.d.ts +3 -0
  10. package/dist/runtime/components/Canvas/components/ToolButton.d.vue.ts +24 -0
  11. package/dist/runtime/components/Canvas/components/ToolButton.vue +62 -0
  12. package/dist/runtime/components/Canvas/components/ToolButton.vue.d.ts +24 -0
  13. package/dist/runtime/components/Canvas/components/Toolbar.d.vue.ts +24 -0
  14. package/dist/runtime/components/Canvas/components/Toolbar.vue +48 -0
  15. package/dist/runtime/components/Canvas/components/Toolbar.vue.d.ts +24 -0
  16. package/dist/runtime/components/Canvas/composables/useCanvasHistory.d.ts +17 -0
  17. package/dist/runtime/components/Canvas/composables/useCanvasHistory.js +76 -0
  18. package/dist/runtime/components/Canvas/composables/useCanvasNodes.d.ts +13 -0
  19. package/dist/runtime/components/Canvas/composables/useCanvasNodes.js +60 -0
  20. package/dist/runtime/components/Canvas/composables/useCanvasSetup.d.ts +5 -0
  21. package/dist/runtime/components/Canvas/composables/useCanvasSetup.js +19 -0
  22. package/dist/runtime/components/Canvas/context.d.ts +38 -0
  23. package/dist/runtime/components/Canvas/context.js +11 -0
  24. package/dist/runtime/components/Canvas/index.d.vue.ts +77 -0
  25. package/dist/runtime/components/Canvas/index.vue +208 -0
  26. package/dist/runtime/components/Canvas/index.vue.d.ts +77 -0
  27. package/dist/runtime/components/Canvas/registry.d.ts +1 -0
  28. package/dist/runtime/components/Canvas/registry.js +2 -0
  29. package/dist/runtime/components/Canvas/tools/ColorPickerWidget.d.vue.ts +7 -0
  30. package/dist/runtime/components/Canvas/tools/ColorPickerWidget.vue +32 -0
  31. package/dist/runtime/components/Canvas/tools/ColorPickerWidget.vue.d.ts +7 -0
  32. package/dist/runtime/components/Canvas/tools/clearTool.d.ts +1 -0
  33. package/dist/runtime/components/Canvas/tools/clearTool.js +16 -0
  34. package/dist/runtime/components/Canvas/tools/colorPickerTool.d.ts +6 -0
  35. package/dist/runtime/components/Canvas/tools/colorPickerTool.js +15 -0
  36. package/dist/runtime/components/Canvas/tools/drawTool.d.ts +16 -0
  37. package/dist/runtime/components/Canvas/tools/drawTool.js +92 -0
  38. package/dist/runtime/components/Canvas/tools/eraseTool.d.ts +5 -0
  39. package/dist/runtime/components/Canvas/tools/eraseTool.js +62 -0
  40. package/dist/runtime/components/Canvas/tools/exportTool.d.ts +18 -0
  41. package/dist/runtime/components/Canvas/tools/exportTool.js +89 -0
  42. package/dist/runtime/components/Canvas/tools/highlightTool.d.ts +11 -0
  43. package/dist/runtime/components/Canvas/tools/highlightTool.js +51 -0
  44. package/dist/runtime/components/Canvas/tools/hitTest.d.ts +20 -0
  45. package/dist/runtime/components/Canvas/tools/hitTest.js +111 -0
  46. package/dist/runtime/components/Canvas/tools/imageTool.d.ts +18 -0
  47. package/dist/runtime/components/Canvas/tools/imageTool.js +163 -0
  48. package/dist/runtime/components/Canvas/tools/moveTool.d.ts +5 -0
  49. package/dist/runtime/components/Canvas/tools/moveTool.js +94 -0
  50. package/dist/runtime/components/Canvas/tools/redoTool.d.ts +1 -0
  51. package/dist/runtime/components/Canvas/tools/redoTool.js +17 -0
  52. package/dist/runtime/components/Canvas/tools/resizeTool.d.ts +7 -0
  53. package/dist/runtime/components/Canvas/tools/resizeTool.js +132 -0
  54. package/dist/runtime/components/Canvas/tools/rotateTool.d.ts +5 -0
  55. package/dist/runtime/components/Canvas/tools/rotateTool.js +109 -0
  56. package/dist/runtime/components/Canvas/tools/textTool.d.ts +14 -0
  57. package/dist/runtime/components/Canvas/tools/textTool.js +99 -0
  58. package/dist/runtime/components/Canvas/tools/tooltips/Clear.d.vue.ts +3 -0
  59. package/dist/runtime/components/Canvas/tools/tooltips/Clear.vue +12 -0
  60. package/dist/runtime/components/Canvas/tools/tooltips/Clear.vue.d.ts +3 -0
  61. package/dist/runtime/components/Canvas/tools/tooltips/Draw.d.vue.ts +3 -0
  62. package/dist/runtime/components/Canvas/tools/tooltips/Draw.vue +12 -0
  63. package/dist/runtime/components/Canvas/tools/tooltips/Draw.vue.d.ts +3 -0
  64. package/dist/runtime/components/Canvas/tools/tooltips/Erase.d.vue.ts +3 -0
  65. package/dist/runtime/components/Canvas/tools/tooltips/Erase.vue +12 -0
  66. package/dist/runtime/components/Canvas/tools/tooltips/Erase.vue.d.ts +3 -0
  67. package/dist/runtime/components/Canvas/tools/tooltips/Export.d.vue.ts +3 -0
  68. package/dist/runtime/components/Canvas/tools/tooltips/Export.vue +13 -0
  69. package/dist/runtime/components/Canvas/tools/tooltips/Export.vue.d.ts +3 -0
  70. package/dist/runtime/components/Canvas/tools/tooltips/Highlight.d.vue.ts +3 -0
  71. package/dist/runtime/components/Canvas/tools/tooltips/Highlight.vue +12 -0
  72. package/dist/runtime/components/Canvas/tools/tooltips/Highlight.vue.d.ts +3 -0
  73. package/dist/runtime/components/Canvas/tools/tooltips/Image.d.vue.ts +3 -0
  74. package/dist/runtime/components/Canvas/tools/tooltips/Image.vue +13 -0
  75. package/dist/runtime/components/Canvas/tools/tooltips/Image.vue.d.ts +3 -0
  76. package/dist/runtime/components/Canvas/tools/tooltips/Move.d.vue.ts +3 -0
  77. package/dist/runtime/components/Canvas/tools/tooltips/Move.vue +13 -0
  78. package/dist/runtime/components/Canvas/tools/tooltips/Move.vue.d.ts +3 -0
  79. package/dist/runtime/components/Canvas/tools/tooltips/Redo.d.vue.ts +3 -0
  80. package/dist/runtime/components/Canvas/tools/tooltips/Redo.vue +13 -0
  81. package/dist/runtime/components/Canvas/tools/tooltips/Redo.vue.d.ts +3 -0
  82. package/dist/runtime/components/Canvas/tools/tooltips/Resize.d.vue.ts +3 -0
  83. package/dist/runtime/components/Canvas/tools/tooltips/Resize.vue +13 -0
  84. package/dist/runtime/components/Canvas/tools/tooltips/Resize.vue.d.ts +3 -0
  85. package/dist/runtime/components/Canvas/tools/tooltips/Rotate.d.vue.ts +3 -0
  86. package/dist/runtime/components/Canvas/tools/tooltips/Rotate.vue +13 -0
  87. package/dist/runtime/components/Canvas/tools/tooltips/Rotate.vue.d.ts +3 -0
  88. package/dist/runtime/components/Canvas/tools/tooltips/Text.d.vue.ts +3 -0
  89. package/dist/runtime/components/Canvas/tools/tooltips/Text.vue +13 -0
  90. package/dist/runtime/components/Canvas/tools/tooltips/Text.vue.d.ts +3 -0
  91. package/dist/runtime/components/Canvas/tools/tooltips/Transform.d.vue.ts +3 -0
  92. package/dist/runtime/components/Canvas/tools/tooltips/Transform.vue +14 -0
  93. package/dist/runtime/components/Canvas/tools/tooltips/Transform.vue.d.ts +3 -0
  94. package/dist/runtime/components/Canvas/tools/tooltips/Undo.d.vue.ts +3 -0
  95. package/dist/runtime/components/Canvas/tools/tooltips/Undo.vue +13 -0
  96. package/dist/runtime/components/Canvas/tools/tooltips/Undo.vue.d.ts +3 -0
  97. package/dist/runtime/components/Canvas/tools/transformHandles.d.ts +74 -0
  98. package/dist/runtime/components/Canvas/tools/transformHandles.js +191 -0
  99. package/dist/runtime/components/Canvas/tools/transformTool.d.ts +7 -0
  100. package/dist/runtime/components/Canvas/tools/transformTool.js +210 -0
  101. package/dist/runtime/components/Canvas/tools/undoTool.d.ts +1 -0
  102. package/dist/runtime/components/Canvas/tools/undoTool.js +17 -0
  103. package/dist/runtime/components/Canvas/types.d.ts +125 -0
  104. package/dist/runtime/components/Canvas/types.js +3 -0
  105. package/dist/runtime/components/ControlElement.vue +5 -1
  106. package/dist/runtime/components/DateRangePicker.vue +16 -4
  107. package/dist/runtime/components/Icon.vue +2 -2
  108. package/dist/runtime/components/LocaleSwitcher.d.vue.ts +13 -0
  109. package/dist/runtime/components/LocaleSwitcher.vue +43 -0
  110. package/dist/runtime/components/LocaleSwitcher.vue.d.ts +13 -0
  111. package/dist/runtime/components/Selector.vue +14 -5
  112. package/dist/runtime/components/Tooltip.vue +17 -7
  113. package/dist/runtime/components/ZoomableContainer.d.vue.ts +48 -0
  114. package/dist/runtime/components/ZoomableContainer.vue +238 -0
  115. package/dist/runtime/components/ZoomableContainer.vue.d.ts +48 -0
  116. package/dist/runtime/components/gallery/Carousel.vue +1 -1
  117. package/dist/runtime/components/gallery/CarouselPreview.d.vue.ts +31 -0
  118. package/dist/runtime/components/gallery/CarouselPreview.vue +64 -0
  119. package/dist/runtime/components/gallery/CarouselPreview.vue.d.ts +31 -0
  120. package/dist/runtime/components/view/Dates.vue +5 -3
  121. package/dist/runtime/components/view/KeyBinds.d.vue.ts +7 -0
  122. package/dist/runtime/components/view/KeyBinds.vue +36 -0
  123. package/dist/runtime/components/view/KeyBinds.vue.d.ts +7 -0
  124. package/dist/runtime/components/view/Text.vue +4 -4
  125. package/dist/runtime/composables/useInertia.d.ts +10 -0
  126. package/dist/runtime/composables/useInertia.js +49 -0
  127. package/dist/runtime/composables/usePinchZoom.d.ts +13 -0
  128. package/dist/runtime/composables/usePinchZoom.js +66 -0
  129. package/dist/runtime/composables/useValidation.js +11 -1
  130. package/dist/runtime/i18n/en.json +20 -0
  131. package/dist/runtime/i18n/index.d.ts +11 -0
  132. package/dist/runtime/i18n/index.js +19 -0
  133. package/dist/runtime/i18n/uk.json +20 -0
  134. package/dist/runtime/index.d.ts +5 -0
  135. package/dist/runtime/index.js +16 -0
  136. package/dist/runtime/plugins/i18n.d.ts +2 -0
  137. package/dist/runtime/plugins/i18n.js +18 -0
  138. package/dist/runtime/utils/icon-registry.js +13 -1
  139. package/package.json +9 -4
@@ -0,0 +1,12 @@
1
+ <template>
2
+ <div class="tool-tip">
3
+ <orio-view-text type="title" size="medium">Draw</orio-view-text>
4
+ <orio-view-text type="subtitle" size="small">
5
+ Freehand pen. Click and drag to draw strokes.
6
+ </orio-view-text>
7
+ </div>
8
+ </template>
9
+
10
+ <style scoped>
11
+ .tool-tip{--view-text-color:#fff;display:flex;flex-direction:column;gap:.25rem;max-width:200px;white-space:normal}
12
+ </style>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,12 @@
1
+ <template>
2
+ <div class="tool-tip">
3
+ <orio-view-text type="title" size="medium">Eraser</orio-view-text>
4
+ <orio-view-text type="subtitle" size="small">
5
+ Drag over elements to remove them. Frozen nodes are protected.
6
+ </orio-view-text>
7
+ </div>
8
+ </template>
9
+
10
+ <style scoped>
11
+ .tool-tip{--view-text-color:#fff;display:flex;flex-direction:column;gap:.25rem;max-width:220px;white-space:normal}
12
+ </style>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <div class="tool-tip">
3
+ <orio-view-text type="title" size="medium">Export</orio-view-text>
4
+ <orio-view-text type="subtitle" size="small">
5
+ Download the canvas as PNG, JPEG, or WebP. Configure format and filename
6
+ via the tool's options.
7
+ </orio-view-text>
8
+ </div>
9
+ </template>
10
+
11
+ <style scoped>
12
+ .tool-tip{--view-text-color:#fff;display:flex;flex-direction:column;gap:.25rem;max-width:240px;white-space:normal}
13
+ </style>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,12 @@
1
+ <template>
2
+ <div class="tool-tip">
3
+ <orio-view-text type="title" size="medium">Highlight</orio-view-text>
4
+ <orio-view-text type="subtitle" size="small">
5
+ Hover over nodes to inspect their bounding box.
6
+ </orio-view-text>
7
+ </div>
8
+ </template>
9
+
10
+ <style scoped>
11
+ .tool-tip{--view-text-color:#fff;display:flex;flex-direction:column;gap:.25rem;max-width:200px;white-space:normal}
12
+ </style>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <div class="tool-tip">
3
+ <orio-view-text type="title" size="medium">Upload image</orio-view-text>
4
+ <orio-view-text type="subtitle" size="small">
5
+ Insert a PNG, JPEG, WebP, GIF, SVG, AVIF, or BMP file. Resize and rotate
6
+ with the Transform tool.
7
+ </orio-view-text>
8
+ </div>
9
+ </template>
10
+
11
+ <style scoped>
12
+ .tool-tip{--view-text-color:#fff;display:flex;flex-direction:column;gap:.25rem;max-width:240px;white-space:normal}
13
+ </style>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <div class="tool-tip">
3
+ <orio-view-text type="title" size="medium">Move</orio-view-text>
4
+ <orio-view-text type="subtitle" size="small">
5
+ Click and drag to reposition nodes.
6
+ </orio-view-text>
7
+ <orio-view-key-binds bind="`]` bring forward · `[` send backward" />
8
+ </div>
9
+ </template>
10
+
11
+ <style scoped>
12
+ .tool-tip{--view-text-color:#fff;display:flex;flex-direction:column;gap:.25rem;max-width:220px;white-space:normal}
13
+ </style>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <div class="tool-tip">
3
+ <orio-view-text type="title" size="medium">Redo</orio-view-text>
4
+ <orio-view-text type="subtitle" size="small">
5
+ Restore the last undone action.
6
+ </orio-view-text>
7
+ <orio-view-key-binds bind="`Ctrl`/`Cmd` + `Shift` + `Z`" />
8
+ </div>
9
+ </template>
10
+
11
+ <style scoped>
12
+ .tool-tip{--view-text-color:#fff;display:flex;flex-direction:column;gap:.25rem;max-width:200px;white-space:normal}
13
+ </style>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <div class="tool-tip">
3
+ <orio-view-text type="title" size="medium">Resize</orio-view-text>
4
+ <orio-view-text type="subtitle" size="small">
5
+ Click a node to select, then drag a handle to resize.
6
+ </orio-view-text>
7
+ <orio-view-key-binds bind="`Esc` deselect" />
8
+ </div>
9
+ </template>
10
+
11
+ <style scoped>
12
+ .tool-tip{--view-text-color:#fff;display:flex;flex-direction:column;gap:.25rem;max-width:220px;white-space:normal}
13
+ </style>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <div class="tool-tip">
3
+ <orio-view-text type="title" size="medium">Rotate</orio-view-text>
4
+ <orio-view-text type="subtitle" size="small">
5
+ Click a node to select, then drag the top circle to rotate.
6
+ </orio-view-text>
7
+ <orio-view-key-binds bind="`Esc` deselect" />
8
+ </div>
9
+ </template>
10
+
11
+ <style scoped>
12
+ .tool-tip{--view-text-color:#fff;display:flex;flex-direction:column;gap:.25rem;max-width:220px;white-space:normal}
13
+ </style>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <div class="tool-tip">
3
+ <orio-view-text type="title" size="medium">Text</orio-view-text>
4
+ <orio-view-text type="subtitle" size="small">
5
+ Click anywhere to place text.
6
+ </orio-view-text>
7
+ <orio-view-key-binds bind="`Enter` commit · `Esc` cancel" />
8
+ </div>
9
+ </template>
10
+
11
+ <style scoped>
12
+ .tool-tip{--view-text-color:#fff;display:flex;flex-direction:column;gap:.25rem;max-width:220px;white-space:normal}
13
+ </style>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,14 @@
1
+ <template>
2
+ <div class="tool-tip">
3
+ <orio-view-text type="title" size="medium">Transform</orio-view-text>
4
+ <orio-view-text type="subtitle" size="small">
5
+ Click a node to select. Drag corners to resize, the top circle to rotate,
6
+ or the body to move.
7
+ </orio-view-text>
8
+ <orio-view-key-binds bind="`Esc` deselect" />
9
+ </div>
10
+ </template>
11
+
12
+ <style scoped>
13
+ .tool-tip{--view-text-color:#fff;display:flex;flex-direction:column;gap:.25rem;max-width:220px;white-space:normal}
14
+ </style>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <div class="tool-tip">
3
+ <orio-view-text type="title" size="medium">Undo</orio-view-text>
4
+ <orio-view-text type="subtitle" size="small">
5
+ Revert the last action.
6
+ </orio-view-text>
7
+ <orio-view-key-binds bind="`Ctrl`/`Cmd` + `Z`" />
8
+ </div>
9
+ </template>
10
+
11
+ <style scoped>
12
+ .tool-tip{--view-text-color:#fff;display:flex;flex-direction:column;gap:.25rem;max-width:200px;white-space:normal}
13
+ </style>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,74 @@
1
+ import type { CanvasNode, CanvasPoint } from "../types.js";
2
+ export type ResizeHandle = "n" | "s" | "e" | "w" | "nw" | "ne" | "sw" | "se";
3
+ export type Handle = ResizeHandle | "rotate";
4
+ export interface Bounds {
5
+ x: number;
6
+ y: number;
7
+ width: number;
8
+ height: number;
9
+ }
10
+ export interface HandleStyle {
11
+ size: number;
12
+ fill: string;
13
+ stroke: string;
14
+ lineWidth: number;
15
+ rotateOffset: number;
16
+ }
17
+ /** Cursor for each resize handle (CSS values). */
18
+ export declare const HANDLE_CURSORS: Record<ResizeHandle, string>;
19
+ /** Map a resize handle through node rotation so cursors match the visual. */
20
+ export declare function cursorForHandle(handle: Handle, rotation?: number): string;
21
+ /** Resize handle anchor positions in node-local (un-rotated) space. */
22
+ export declare function getResizeHandles(b: Bounds): Record<ResizeHandle, CanvasPoint>;
23
+ /** Rotation handle anchor — sits above the top-center of the bounds. */
24
+ export declare function getRotationHandle(b: Bounds, offset?: number): CanvasPoint;
25
+ /**
26
+ * Hit-test the handles of a (possibly rotated) node.
27
+ *
28
+ * @returns the matched handle name or `null` if the point is outside all handles.
29
+ */
30
+ export declare function hitHandle(node: CanvasNode, point: CanvasPoint, opts?: {
31
+ style?: Partial<HandleStyle>;
32
+ /** Restrict which handles can be hit (e.g. resize-only tools). */
33
+ handles?: Handle[];
34
+ }): Handle | null;
35
+ /** Render resize handles on a node's bounding rect, applying rotation. */
36
+ export declare function renderResizeHandles(ctx: CanvasRenderingContext2D, node: CanvasNode, opts?: {
37
+ style?: Partial<HandleStyle>;
38
+ handles?: ResizeHandle[];
39
+ hovered?: ResizeHandle | null;
40
+ }): void;
41
+ /** Render rotation handle (line + circle) above the node, applying rotation. */
42
+ export declare function renderRotationHandle(ctx: CanvasRenderingContext2D, node: CanvasNode, opts?: {
43
+ style?: Partial<HandleStyle>;
44
+ hovered?: boolean;
45
+ }): void;
46
+ /** Wrap a delta into (-π, π] so multi-turn drags don't jump at atan2's boundary. */
47
+ export declare function normalizeAngleDelta(delta: number): number;
48
+ /**
49
+ * Compute a node's rotation given a pointer position. The rotation is the
50
+ * angle from the node's bounds-center to `point`, with 0 meaning the
51
+ * rotation handle pointing straight up.
52
+ */
53
+ export declare function rotationFromPoint(node: CanvasNode, point: CanvasPoint): number;
54
+ export interface ResizeContext {
55
+ /** Node snapshot taken at pointer-down. */
56
+ original: CanvasNode;
57
+ /** Bounds of `original`. */
58
+ originalBounds: Bounds;
59
+ /** Pointer in canvas-space at pointer-down (already in local coords). */
60
+ startLocal: CanvasPoint;
61
+ }
62
+ /**
63
+ * Compute a patch that resizes `ctx.original` so the dragged handle lines up
64
+ * with the current pointer.
65
+ *
66
+ * - For width/height nodes: patches `x`, `y`, `width`, `height`.
67
+ * - For draw nodes (with `data.points`): scales each point relative to the
68
+ * original bounds.
69
+ * - For text nodes (with `data.fontSize`): uniform scale via `fontSize`,
70
+ * only on corner handles.
71
+ */
72
+ export declare function computeResizePatch(handle: ResizeHandle, pointerLocal: CanvasPoint, ctx: ResizeContext, opts?: {
73
+ minSize?: number;
74
+ }): Partial<Omit<CanvasNode, "id">> | null;
@@ -0,0 +1,191 @@
1
+ import { getNodeBounds, toLocalPoint } from "./hitTest.js";
2
+ const DEFAULT_STYLE = {
3
+ size: 10,
4
+ fill: "transparent",
5
+ stroke: "rgba(31, 122, 236, 1)",
6
+ lineWidth: 1.5,
7
+ rotateOffset: 28
8
+ };
9
+ const HOVER_ALPHA = 0.4;
10
+ export const HANDLE_CURSORS = {
11
+ n: "ns-resize",
12
+ s: "ns-resize",
13
+ e: "ew-resize",
14
+ w: "ew-resize",
15
+ nw: "nwse-resize",
16
+ se: "nwse-resize",
17
+ ne: "nesw-resize",
18
+ sw: "nesw-resize"
19
+ };
20
+ export function cursorForHandle(handle, rotation = 0) {
21
+ if (handle === "rotate") return "grab";
22
+ if (!rotation) return HANDLE_CURSORS[handle];
23
+ const order = ["n", "ne", "e", "se", "s", "sw", "w", "nw"];
24
+ const idx = order.indexOf(handle);
25
+ const step = Math.round(rotation * 4 / Math.PI);
26
+ return HANDLE_CURSORS[order[((idx + step) % 8 + 8) % 8]];
27
+ }
28
+ export function getResizeHandles(b) {
29
+ const cx = b.x + b.width / 2;
30
+ const cy = b.y + b.height / 2;
31
+ return {
32
+ nw: { x: b.x, y: b.y },
33
+ n: { x: cx, y: b.y },
34
+ ne: { x: b.x + b.width, y: b.y },
35
+ e: { x: b.x + b.width, y: cy },
36
+ se: { x: b.x + b.width, y: b.y + b.height },
37
+ s: { x: cx, y: b.y + b.height },
38
+ sw: { x: b.x, y: b.y + b.height },
39
+ w: { x: b.x, y: cy }
40
+ };
41
+ }
42
+ export function getRotationHandle(b, offset = DEFAULT_STYLE.rotateOffset) {
43
+ return { x: b.x + b.width / 2, y: b.y - offset };
44
+ }
45
+ export function hitHandle(node, point, opts = {}) {
46
+ const style = { ...DEFAULT_STYLE, ...opts.style };
47
+ const allowed = new Set(
48
+ opts.handles ?? ["n", "s", "e", "w", "nw", "ne", "sw", "se", "rotate"]
49
+ );
50
+ const bounds = getNodeBounds(node);
51
+ const local = toLocalPoint(node, point);
52
+ const r = style.size / 2 + 2;
53
+ if (allowed.has("rotate")) {
54
+ const h = getRotationHandle(bounds, style.rotateOffset);
55
+ if ((local.x - h.x) ** 2 + (local.y - h.y) ** 2 <= (r + 2) ** 2) {
56
+ return "rotate";
57
+ }
58
+ }
59
+ const resize = getResizeHandles(bounds);
60
+ for (const key of Object.keys(resize)) {
61
+ if (!allowed.has(key)) continue;
62
+ const h = resize[key];
63
+ if (Math.abs(local.x - h.x) <= r && Math.abs(local.y - h.y) <= r) {
64
+ return key;
65
+ }
66
+ }
67
+ return null;
68
+ }
69
+ export function renderResizeHandles(ctx, node, opts = {}) {
70
+ const style = { ...DEFAULT_STYLE, ...opts.style };
71
+ const bounds = getNodeBounds(node);
72
+ const all = getResizeHandles(bounds);
73
+ const list = opts.handles ?? Object.keys(all);
74
+ ctx.save();
75
+ if (node.rotation) {
76
+ const cx = bounds.x + bounds.width / 2;
77
+ const cy = bounds.y + bounds.height / 2;
78
+ ctx.translate(cx, cy);
79
+ ctx.rotate(node.rotation);
80
+ ctx.translate(-cx, -cy);
81
+ }
82
+ ctx.fillStyle = style.fill;
83
+ ctx.strokeStyle = style.stroke;
84
+ ctx.lineWidth = style.lineWidth;
85
+ for (const key of list) {
86
+ const p = all[key];
87
+ const half = style.size / 2;
88
+ const hovered = opts.hovered === key;
89
+ if (hovered) {
90
+ ctx.save();
91
+ ctx.globalAlpha = HOVER_ALPHA;
92
+ }
93
+ ctx.beginPath();
94
+ ctx.rect(p.x - half, p.y - half, style.size, style.size);
95
+ ctx.fill();
96
+ ctx.stroke();
97
+ if (hovered) ctx.restore();
98
+ }
99
+ ctx.restore();
100
+ }
101
+ export function renderRotationHandle(ctx, node, opts = {}) {
102
+ const style = { ...DEFAULT_STYLE, ...opts.style };
103
+ const bounds = getNodeBounds(node);
104
+ const top = { x: bounds.x + bounds.width / 2, y: bounds.y };
105
+ const handle = getRotationHandle(bounds, style.rotateOffset);
106
+ const r = style.size / 2 + 1;
107
+ ctx.save();
108
+ if (node.rotation) {
109
+ const cx = bounds.x + bounds.width / 2;
110
+ const cy = bounds.y + bounds.height / 2;
111
+ ctx.translate(cx, cy);
112
+ ctx.rotate(node.rotation);
113
+ ctx.translate(-cx, -cy);
114
+ }
115
+ ctx.strokeStyle = style.stroke;
116
+ ctx.fillStyle = style.fill;
117
+ ctx.lineWidth = style.lineWidth;
118
+ if (opts.hovered) ctx.globalAlpha = HOVER_ALPHA;
119
+ ctx.beginPath();
120
+ ctx.moveTo(top.x, top.y);
121
+ ctx.lineTo(handle.x, handle.y);
122
+ ctx.stroke();
123
+ ctx.beginPath();
124
+ ctx.arc(handle.x, handle.y, r, 0, Math.PI * 2);
125
+ ctx.fill();
126
+ ctx.stroke();
127
+ ctx.restore();
128
+ }
129
+ export function normalizeAngleDelta(delta) {
130
+ const TAU = Math.PI * 2;
131
+ return ((delta + Math.PI) % TAU + TAU) % TAU - Math.PI;
132
+ }
133
+ export function rotationFromPoint(node, point) {
134
+ const b = getNodeBounds(node);
135
+ const cx = b.x + b.width / 2;
136
+ const cy = b.y + b.height / 2;
137
+ return Math.atan2(point.y - cy, point.x - cx) + Math.PI / 2;
138
+ }
139
+ export function computeResizePatch(handle, pointerLocal, ctx, opts = {}) {
140
+ const minSize = opts.minSize ?? 8;
141
+ const ob = ctx.originalBounds;
142
+ let nx = ob.x;
143
+ let ny = ob.y;
144
+ let nw = ob.width;
145
+ let nh = ob.height;
146
+ if (handle.includes("e")) nw = Math.max(minSize, pointerLocal.x - ob.x);
147
+ if (handle.includes("s")) nh = Math.max(minSize, pointerLocal.y - ob.y);
148
+ if (handle.includes("w")) {
149
+ const right = ob.x + ob.width;
150
+ nx = Math.min(pointerLocal.x, right - minSize);
151
+ nw = right - nx;
152
+ }
153
+ if (handle.includes("n")) {
154
+ const bottom = ob.y + ob.height;
155
+ ny = Math.min(pointerLocal.y, bottom - minSize);
156
+ nh = bottom - ny;
157
+ }
158
+ const data = ctx.original.data;
159
+ if (ctx.original.width != null && ctx.original.height != null) {
160
+ return { x: nx, y: ny, width: nw, height: nh };
161
+ }
162
+ if (Array.isArray(data?.points)) {
163
+ const points = data.points;
164
+ const sx = ob.width === 0 ? 1 : nw / ob.width;
165
+ const sy = ob.height === 0 ? 1 : nh / ob.height;
166
+ return {
167
+ x: ctx.original.x,
168
+ y: ctx.original.y,
169
+ data: {
170
+ ...data,
171
+ points: points.map((p) => ({
172
+ x: nx + (p.x - ob.x) * sx,
173
+ y: ny + (p.y - ob.y) * sy
174
+ }))
175
+ }
176
+ };
177
+ }
178
+ if (typeof data?.text === "string" && typeof data?.fontSize === "number") {
179
+ if (!["nw", "ne", "sw", "se"].includes(handle)) return null;
180
+ const sx = ob.width === 0 ? 1 : nw / ob.width;
181
+ const sy = ob.height === 0 ? 1 : nh / ob.height;
182
+ const scale = Math.max(sx, sy);
183
+ const newFont = Math.max(minSize, data.fontSize * scale);
184
+ return {
185
+ x: nx,
186
+ y: ny + (newFont - data.fontSize) / 2,
187
+ data: { ...data, fontSize: newFont }
188
+ };
189
+ }
190
+ return null;
191
+ }
@@ -0,0 +1,7 @@
1
+ export interface TransformToolOptions extends Record<string, unknown> {
2
+ /** Hit-test radius in CSS pixels for picking a node to select. */
3
+ radius: number;
4
+ /** Minimum side length when resizing. */
5
+ minSize: number;
6
+ }
7
+ export declare function transformTool(options?: Partial<TransformToolOptions>): import("../types.js").CanvasTool<never, TransformToolOptions>;