@kubohiroya/turbowarp-plus-editor-code-views 0.21.2 → 0.22.0

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 (52) hide show
  1. package/EDITOR-MIGRATION.md +5 -0
  2. package/README.ja.md +16 -1
  3. package/dist/code-pane.d.ts +7 -1
  4. package/dist/code-pane.js +45 -3
  5. package/dist/code-popout.d.ts +10 -0
  6. package/dist/code-popout.js +402 -0
  7. package/dist/context-menu-icons.d.ts +15 -0
  8. package/dist/context-menu-icons.js +204 -0
  9. package/dist/desktop-code.d.ts +11 -0
  10. package/dist/desktop-code.js +47 -0
  11. package/dist/horizontal-block-palette.d.ts +39 -0
  12. package/dist/horizontal-block-palette.js +774 -0
  13. package/dist/palette-delete-preview.d.ts +3 -0
  14. package/dist/palette-delete-preview.js +73 -0
  15. package/dist/script-arrows.js +106 -12
  16. package/dist/script-layout-view.js +122 -6
  17. package/dist/script-layout-workspace.js +7 -2
  18. package/dist/script-layout.d.ts +1 -1
  19. package/dist/script-layout.js +3 -3
  20. package/dist/script-projection.d.ts +8 -0
  21. package/dist/script-projection.js +10 -0
  22. package/dist/script-view-menu.d.ts +1 -0
  23. package/dist/script-view-menu.js +4 -2
  24. package/dist/serial-script-editor.d.ts +4 -0
  25. package/dist/serial-script-editor.js +43 -0
  26. package/dist/workspace-overview.js +67 -25
  27. package/dist/workspace.d.ts +1 -0
  28. package/dist/workspace.js +3 -2
  29. package/package.json +27 -3
  30. package/src/code-pane.ts +41 -3
  31. package/src/code-popout.tsx +399 -0
  32. package/src/context-menu-icons.css +14 -0
  33. package/src/context-menu-icons.ts +215 -0
  34. package/src/desktop-code.ts +45 -0
  35. package/src/horizontal-block-palette.css +111 -0
  36. package/src/horizontal-block-palette.ts +765 -0
  37. package/src/palette-delete-preview.css +21 -0
  38. package/src/palette-delete-preview.ts +79 -0
  39. package/src/pin-off.svg +6 -0
  40. package/src/pin.svg +5 -0
  41. package/src/script-arrows.ts +98 -12
  42. package/src/script-layout-view.ts +114 -6
  43. package/src/script-layout-workspace.ts +7 -2
  44. package/src/script-layout.ts +4 -3
  45. package/src/script-projection.ts +12 -0
  46. package/src/script-view-menu.ts +5 -2
  47. package/src/serial-script-editor.ts +41 -0
  48. package/src/styles.css +80 -5
  49. package/src/trash.svg +3 -0
  50. package/src/workspace-overview.ts +63 -22
  51. package/src/workspace.ts +3 -2
  52. package/tsconfig.json +87 -1
@@ -0,0 +1,111 @@
1
+ /* SPDX-License-Identifier: MPL-2.0 */
2
+ /* Keep the palette and its scrollbar within the code surface's own stacking context. */
3
+ :global(.injectionDiv):has(> :global([data-horizontal-block-palette])) {
4
+ isolation: isolate;
5
+ }
6
+
7
+ :global([data-detached-palette-source]) {
8
+ visibility: hidden !important;
9
+ pointer-events: none;
10
+ }
11
+
12
+
13
+
14
+ .horizontal:global(.blocklyToolboxDiv)[data-horizontal-block-palette] {
15
+ inset: 0 var(--plus-stage-overlap, 0px) auto 0;
16
+ height: auto !important;
17
+ overflow-x: auto;
18
+ overflow-y: hidden;
19
+ scrollbar-width: thin;
20
+ }
21
+
22
+ .horizontal:global(.blocklyToolboxDiv)::-webkit-scrollbar {
23
+ display: initial;
24
+ }
25
+
26
+ .horizontal:global(.blocklyToolboxDiv)[data-horizontal-block-palette] {
27
+ display: flex;
28
+ align-items: center;
29
+ }
30
+
31
+ .horizontal :global(.scratchCategoryMenu) {
32
+ display: flex;
33
+ flex: 1 0 auto;
34
+ width: max-content;
35
+ }
36
+
37
+ /* The ▼ menu at the end of the categories: the right end of a horizontal palette, the bottom of a vertical one. */
38
+ .horizontal > :global(.tw-palette-menu-button) {
39
+ position: sticky;
40
+ right: 0;
41
+ background: var(--ui-primary, white);
42
+ }
43
+
44
+ :global(.blocklyToolboxDiv):not(.horizontal) > :global(.tw-palette-menu-button) {
45
+ display: flex;
46
+ margin: 0.25rem auto;
47
+ }
48
+
49
+ .horizontal :global(.scratchCategoryMenuItem) {
50
+ padding-inline: 0.65rem;
51
+ white-space: nowrap;
52
+ }
53
+
54
+ .horizontal :global(.scratchCategoryMenuItem.categorySelected)[aria-expanded="false"]:not([data-palette-group-shown]) {
55
+ background: transparent;
56
+ }
57
+
58
+ .panel:global(.blocklyFlyout) {
59
+ z-index: 29;
60
+ filter: drop-shadow(0 3px 6px rgb(0 0 0 / 25%));
61
+ }
62
+
63
+ .panel :global(.blocklyFlyoutBackground) {
64
+ fill-opacity: 1;
65
+ }
66
+
67
+ .scrollbar:global(.blocklyFlyoutScrollbar) {
68
+ z-index: 31;
69
+ }
70
+
71
+ /* The auto-hide addon slides the vertical flyout away by changing its left margin. */
72
+ :global(.injectionDiv) > .panel:global(.blocklyFlyout.sa-flyoutClose),
73
+ :global(.injectionDiv) > .scrollbar:global(.blocklyFlyoutScrollbar.sa-flyoutClose) {
74
+ margin-left: 0;
75
+ }
76
+
77
+ .panel:global(.blocklyFlyout) > :global(.sa-lock-object) {
78
+ /* Anchor the addon's SVG control to the current flyout viewport. */
79
+ x: max(0px, calc(100% - 32px - 15px));
80
+ y: 3px;
81
+ width: min(32px, 100%);
82
+ transform: none;
83
+ }
84
+
85
+ .panel:global(.blocklyFlyout) > :global(.sa-lock-object) > :global(.sa-lock-button) {
86
+ background-color: transparent;
87
+ border-color: transparent;
88
+ color: rgb(128 128 128 / 88%);
89
+ }
90
+
91
+ .panel:global(.blocklyFlyout) > :global(.sa-lock-object.locked) > :global(.sa-lock-button) {
92
+ border-color: currentColor;
93
+ color: var(--text-primary, #404040);
94
+ color: light-dark(#404040, #d4d4d4);
95
+ }
96
+
97
+ .panel:global(.blocklyFlyout) :global(.sa-lock-button) img {
98
+ display: none;
99
+ }
100
+
101
+ .panel:global(.blocklyFlyout) :global(.sa-lock-button)::before {
102
+ content: '';
103
+ width: 20px;
104
+ height: 20px;
105
+ background-color: currentColor;
106
+ mask: url('./pin-off.svg') center / contain no-repeat;
107
+ }
108
+
109
+ .panel:global(.blocklyFlyout) :global(.sa-lock-object.locked .sa-lock-button)::before {
110
+ mask-image: url('./pin.svg');
111
+ }