@widgetic/canvas 0.5.42 → 0.5.44

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 (69) hide show
  1. package/README.md +1 -0
  2. package/dist/canvas/DomCanvas.svelte +53 -20
  3. package/dist/canvas/DomCanvas.svelte.d.ts +19 -7
  4. package/dist/canvas/chromeLayout.d.ts +14 -3
  5. package/dist/canvas/chromeLayout.js +14 -3
  6. package/dist/canvas/host/CanvasHost.d.ts +66 -6
  7. package/dist/canvas/host/CanvasHost.js +316 -91
  8. package/dist/canvas/host/CanvasHostApi.d.ts +2 -2
  9. package/dist/canvas/host/CanvasHostApi.js +5 -1
  10. package/dist/canvas/host/nearCards.d.ts +33 -0
  11. package/dist/canvas/host/nearCards.js +78 -0
  12. package/dist/canvas/host/pageEvents.d.ts +16 -4
  13. package/dist/canvas/host/pageEvents.js +13 -4
  14. package/dist/canvas/host/pictureSaves.d.ts +33 -0
  15. package/dist/canvas/host/pictureSaves.js +42 -0
  16. package/dist/canvas/host/screenRects.d.ts +5 -0
  17. package/dist/canvas/host/storedPictures.d.ts +88 -0
  18. package/dist/canvas/host/storedPictures.js +288 -0
  19. package/dist/canvas/index.d.ts +2 -1
  20. package/dist/canvas/index.js +1 -1
  21. package/dist/canvas/shapes/shapeImageStore.d.ts +45 -2
  22. package/dist/canvas/shapes/shapeImageStore.js +7 -0
  23. package/dist/canvas/toolbarPosition.d.ts +2 -2
  24. package/dist/canvas/toolbarPosition.js +2 -2
  25. package/dist/canvas/types.d.ts +17 -0
  26. package/dist/canvas/ui/ColorField.svelte +7 -2
  27. package/dist/canvas/ui/SelectionPanel.svelte +56 -31
  28. package/dist/canvas/ui/SelectionPanel.svelte.d.ts +7 -0
  29. package/dist/canvas/ui/SelectorIndicator.svelte +81 -0
  30. package/dist/canvas/ui/SelectorIndicator.svelte.d.ts +11 -0
  31. package/dist/canvas/ui/ToolButton.svelte +11 -3
  32. package/dist/canvas/ui/floatingCard.d.ts +2 -2
  33. package/dist/canvas/ui/floatingCard.js +2 -2
  34. package/dist/canvas/ui/floatingLayer.d.ts +13 -2
  35. package/dist/canvas/ui/floatingLayer.js +14 -2
  36. package/dist/canvas/view/CanvasStage.svelte +101 -67
  37. package/dist/canvas/view/LeftToRightScope.svelte +21 -0
  38. package/dist/canvas/view/LeftToRightScope.svelte.d.ts +7 -0
  39. package/dist/canvas/view/ObjectView.svelte +15 -10
  40. package/dist/canvas/view/ObjectView.svelte.d.ts +1 -1
  41. package/dist/canvas/view/liftedScene.d.ts +31 -0
  42. package/dist/canvas/view/liftedScene.js +146 -0
  43. package/dist/canvas/view/mountedScene.d.ts +71 -0
  44. package/dist/canvas/view/mountedScene.js +363 -0
  45. package/dist/engine/EngineCore.d.ts +89 -1
  46. package/dist/engine/EngineCore.js +158 -4
  47. package/dist/engine/codec/canvasDocument.d.ts +5 -0
  48. package/dist/engine/codec/canvasDocument.js +31 -4
  49. package/dist/engine/core/cameraMove.d.ts +67 -0
  50. package/dist/engine/core/cameraMove.js +154 -0
  51. package/dist/engine/core/history.d.ts +6 -0
  52. package/dist/engine/core/history.js +16 -0
  53. package/dist/engine/core/scene.d.ts +10 -0
  54. package/dist/engine/core/scene.js +24 -0
  55. package/dist/engine/core/types.d.ts +8 -2
  56. package/dist/engine/input/PointerController.js +12 -0
  57. package/dist/engine/input/gestures.js +4 -2
  58. package/dist/engine/state.d.ts +20 -0
  59. package/dist/engine/state.js +1 -0
  60. package/dist/fonts/interFont.d.ts +10 -1
  61. package/dist/fonts/interFont.js +36 -13
  62. package/dist/i18n/language.d.ts +3 -3
  63. package/dist/i18n/messages.d.ts +8 -1
  64. package/dist/i18n/messages.js +9 -1
  65. package/dist/index.d.ts +2 -2
  66. package/dist/index.js +1 -1
  67. package/package.json +1 -1
  68. package/dist/canvas/ui/SelectorBar.svelte +0 -84
  69. package/dist/canvas/ui/SelectorBar.svelte.d.ts +0 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widgetic/canvas",
3
- "version": "0.5.42",
3
+ "version": "0.5.44",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "type": "module",
6
6
  "svelte": "./dist/index.js",
@@ -1,84 +0,0 @@
1
- <!--
2
- The element selector bar: what stands where the toolbar stood once the page has hidden the drawing tools (after the first
3
- generation) and asks for the selector instead.
4
-
5
- One toggle that puts the page's element selector on or off, and, whenever the page gave its words, the line that says how to
6
- use it (click, the arrow keys to move between parent and child, a held key to use the widget, Escape to finish). The bar has
7
- one form only, the open one: the instructions are there before the toggle is pressed, not after (it used to shrink to the
8
- toggle while the selector was off and grow when it was on).
9
- The words come from the page (`selectorGuide`), already in its language; the key caps are the keys themselves.
10
-
11
- The bar stands where the toolbar stands (`toolbarPosition`). On the left or the right edge it stands upright, and the line
12
- of words becomes four short lines under the toggle.
13
- -->
14
- <script lang="ts">
15
- import { useCanvasLanguage } from '../../i18n/language.js';
16
- import { isSideAnchor, popoverSideFor } from '../chromeLayout.js';
17
- import type { ChromeAnchor } from '../chromeLayout.js';
18
- import type { SelectorGuide } from '../host/CanvasHost.js';
19
- import { FLOATING_CARD_CLASSES } from './floatingCard.js';
20
- import { IconSelectElement } from './icons.js';
21
- import { providePopoverSide } from './popoverSide.js';
22
- import ToolButton from './ToolButton.svelte';
23
-
24
- interface Props {
25
- active: boolean;
26
- guide: SelectorGuide | null;
27
- /** Where the bar stands (see `chromeLayout.ts`): it stands upright on the left and the right edge. */
28
- anchor: ChromeAnchor;
29
- onToggle: () => void;
30
- }
31
-
32
- let { active, guide, anchor, onToggle }: Props = $props();
33
-
34
- const { t } = useCanvasLanguage();
35
-
36
- const vertical = $derived(isSideAnchor(anchor));
37
- providePopoverSide(() => popoverSideFor(anchor));
38
- </script>
39
-
40
- {#snippet keyCap(cap: string)}
41
- <kbd class="rounded-md border border-border bg-muted px-1.5 py-0.5 font-sans text-xs text-muted-foreground">{cap}</kbd>
42
- {/snippet}
43
-
44
- {#snippet dot()}
45
- <span class="text-border" aria-hidden="true">·</span>
46
- {/snippet}
47
-
48
- <!-- `widget-selector-bar` is the name pages' own tests have always found the bar by. -->
49
- <div
50
- role="group"
51
- aria-label={$t('canvas.tool.selector')}
52
- data-canvas-selector-bar
53
- data-anchor={anchor}
54
- class="widget-selector-bar pointer-events-auto flex items-center gap-1 whitespace-nowrap {vertical ? 'max-h-full flex-col overflow-y-auto' : 'max-w-full flex-nowrap'} {FLOATING_CARD_CLASSES}"
55
- >
56
- <ToolButton toggle label={$t('canvas.tool.selector')} active={active} onclick={onToggle}>
57
- <IconSelectElement />
58
- </ToolButton>
59
- {#if guide}
60
- {#if vertical}
61
- <div class="flex flex-col items-start gap-1.5 px-1 pb-1.5 text-caption-medium text-muted-foreground">
62
- <span>{guide.click}</span>
63
- <span class="flex items-center gap-1.5">{@render keyCap('↑')}{@render keyCap('↓')}<span>{guide.parentChild}</span></span>
64
- <span class="flex items-center gap-1.5"><span>{guide.hold}</span>{@render keyCap(guide.cmd)}<span>{guide.interact}</span></span>
65
- <span class="flex items-center gap-1.5">{@render keyCap(guide.esc)}<span>{guide.done}</span></span>
66
- </div>
67
- {:else}
68
- <div class="flex flex-nowrap items-center gap-1.5 pe-3 ps-1 text-caption-medium text-muted-foreground">
69
- <span>{guide.click}</span>
70
- {@render dot()}
71
- {@render keyCap('↑')}
72
- {@render keyCap('↓')}
73
- <span>{guide.parentChild}</span>
74
- {@render dot()}
75
- <span>{guide.hold}</span>
76
- {@render keyCap(guide.cmd)}
77
- <span>{guide.interact}</span>
78
- {@render dot()}
79
- {@render keyCap(guide.esc)}
80
- <span>{guide.done}</span>
81
- </div>
82
- {/if}
83
- {/if}
84
- </div>
@@ -1,12 +0,0 @@
1
- import type { ChromeAnchor } from '../chromeLayout.js';
2
- import type { SelectorGuide } from '../host/CanvasHost.js';
3
- interface Props {
4
- active: boolean;
5
- guide: SelectorGuide | null;
6
- /** Where the bar stands (see `chromeLayout.ts`): it stands upright on the left and the right edge. */
7
- anchor: ChromeAnchor;
8
- onToggle: () => void;
9
- }
10
- declare const SelectorBar: import("svelte").Component<Props, {}, "">;
11
- type SelectorBar = ReturnType<typeof SelectorBar>;
12
- export default SelectorBar;