fragment-tools 0.1.20 → 0.2.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 (104) hide show
  1. package/bin/index.js +2 -2
  2. package/package.json +5 -6
  3. package/src/cli/build.js +1 -1
  4. package/src/cli/run.js +1 -1
  5. package/src/cli/templates/three-fragment/index.js +6 -6
  6. package/src/cli/templates/three-orthographic/index.js +3 -3
  7. package/src/cli/templates/three-perspective/index.js +3 -3
  8. package/src/client/app/actions/resize.js +14 -0
  9. package/src/client/app/components/HintLoading.svelte +94 -0
  10. package/src/client/app/components/HintPaused.svelte +88 -0
  11. package/src/client/app/components/HintRecord.svelte +62 -0
  12. package/src/client/app/components/IconLocked.svelte +51 -0
  13. package/src/client/app/components/IconTriggers.svelte +48 -0
  14. package/src/client/app/components/Init.svelte +14 -27
  15. package/src/client/app/components/KeyBinding.svelte +3 -6
  16. package/src/client/app/helpers.js +4 -40
  17. package/src/client/app/hooks.js +41 -17
  18. package/src/client/app/inputs/MIDI.js +2 -1
  19. package/src/client/app/lib/canvas-recorder/CanvasRecorder.js +6 -1
  20. package/src/client/app/lib/gl/Renderer.js +1 -0
  21. package/src/client/app/lib/svelte-json-tree/ErrorNode.svelte +28 -0
  22. package/src/client/app/lib/svelte-json-tree/ErrorStack.svelte +31 -0
  23. package/src/client/app/lib/svelte-json-tree/Expandable.svelte +25 -0
  24. package/src/client/app/lib/svelte-json-tree/JSONArrayNode.svelte +38 -0
  25. package/src/client/app/lib/svelte-json-tree/JSONArrow.svelte +47 -0
  26. package/src/client/app/lib/svelte-json-tree/JSONFunctionNode.svelte +114 -0
  27. package/src/client/app/lib/svelte-json-tree/JSONIterableArrayNode.svelte +60 -0
  28. package/src/client/app/lib/svelte-json-tree/JSONIterableMapNode.svelte +87 -0
  29. package/src/client/app/lib/svelte-json-tree/JSONNested.svelte +94 -0
  30. package/src/client/app/lib/svelte-json-tree/JSONNode.svelte +91 -0
  31. package/src/client/app/lib/svelte-json-tree/JSONObjectNode.svelte +40 -0
  32. package/src/client/app/lib/svelte-json-tree/JSONStringNode.svelte +31 -0
  33. package/src/client/app/lib/svelte-json-tree/JSONValueNode.svelte +31 -0
  34. package/src/client/app/lib/svelte-json-tree/PreviewList.svelte +38 -0
  35. package/src/client/app/lib/svelte-json-tree/RegExpNode.svelte +42 -0
  36. package/src/client/app/lib/svelte-json-tree/Root.svelte +75 -0
  37. package/src/client/app/lib/svelte-json-tree/Summary.svelte +9 -0
  38. package/src/client/app/lib/svelte-json-tree/TypedArrayNode.svelte +56 -0
  39. package/src/client/app/lib/svelte-json-tree/index.js +1 -0
  40. package/src/client/app/lib/svelte-json-tree/utils.js +57 -0
  41. package/src/client/app/modules/Console/ConsoleLine.svelte +12 -11
  42. package/src/client/app/modules/Console.svelte +82 -17
  43. package/src/client/app/modules/Exports.svelte +48 -48
  44. package/src/client/app/modules/MidiPanel.svelte +12 -19
  45. package/src/client/app/modules/Monitor.svelte +147 -55
  46. package/src/client/app/modules/Params.svelte +127 -80
  47. package/src/client/app/renderers/2DRenderer.js +1 -0
  48. package/src/client/app/renderers/FragmentRenderer.js +1 -1
  49. package/src/client/app/renderers/P5GLRenderer.js +11 -5
  50. package/src/client/app/renderers/P5Renderer.js +7 -3
  51. package/src/client/app/renderers/THREERenderer.js +42 -79
  52. package/src/client/app/state/Sketch.svelte.js +538 -0
  53. package/src/client/app/state/errors.svelte.js +17 -0
  54. package/src/client/app/state/exports.svelte.js +152 -0
  55. package/src/client/app/state/layout.svelte.js +205 -0
  56. package/src/client/app/state/monitors.svelte.js +36 -0
  57. package/src/client/app/state/renderers.svelte.js +77 -0
  58. package/src/client/app/state/rendering.svelte.js +697 -0
  59. package/src/client/app/state/sketches.svelte.js +73 -0
  60. package/src/client/app/state/utils.svelte.js +65 -0
  61. package/src/client/app/ui/Build.svelte +53 -60
  62. package/src/client/app/ui/ErrorOverlay.svelte +2 -2
  63. package/src/client/app/ui/Field.svelte +63 -189
  64. package/src/client/app/ui/FieldGroup.svelte +4 -5
  65. package/src/client/app/ui/FieldSection.svelte +14 -9
  66. package/src/client/app/ui/FieldSpace.svelte +1 -1
  67. package/src/client/app/ui/FieldTrigger.svelte +86 -84
  68. package/src/client/app/ui/FieldTriggers.svelte +25 -24
  69. package/src/client/app/ui/FloatingParams.svelte +50 -12
  70. package/src/client/app/ui/Layout.svelte +24 -13
  71. package/src/client/app/ui/LayoutColumn.svelte +2 -2
  72. package/src/client/app/ui/LayoutComponent.svelte +86 -195
  73. package/src/client/app/ui/LayoutResizer.svelte +25 -37
  74. package/src/client/app/ui/LayoutRoot.svelte +3 -5
  75. package/src/client/app/ui/LayoutRow.svelte +2 -2
  76. package/src/client/app/ui/LayoutToolbar.svelte +17 -76
  77. package/src/client/app/ui/Module.svelte +31 -35
  78. package/src/client/app/ui/ModuleHeaderAction.svelte +23 -16
  79. package/src/client/app/ui/ModuleHeaderButton.svelte +3 -3
  80. package/src/client/app/ui/ModuleHeaderSelect.svelte +4 -12
  81. package/src/client/app/ui/ModuleRenderer.svelte +84 -22
  82. package/src/client/app/ui/ParamsOutput.svelte +61 -77
  83. package/src/client/app/ui/Preview.svelte +15 -4
  84. package/src/client/app/ui/SelectChevrons.svelte +1 -2
  85. package/src/client/app/ui/SketchRenderer.svelte +89 -701
  86. package/src/client/app/ui/SketchSelect.svelte +14 -49
  87. package/src/client/app/ui/fields/ButtonInput.svelte +14 -11
  88. package/src/client/app/ui/fields/CheckboxInput.svelte +5 -12
  89. package/src/client/app/ui/fields/ColorInput.svelte +46 -121
  90. package/src/client/app/ui/fields/FieldInputRow.svelte +5 -1
  91. package/src/client/app/ui/fields/ImageInput.svelte +14 -14
  92. package/src/client/app/ui/fields/Input.svelte +19 -25
  93. package/src/client/app/ui/fields/IntervalInput.svelte +22 -22
  94. package/src/client/app/ui/fields/NumberInput.svelte +32 -38
  95. package/src/client/app/ui/fields/ProgressInput.svelte +14 -13
  96. package/src/client/app/ui/fields/Select.svelte +34 -45
  97. package/src/client/app/ui/fields/TextInput.svelte +10 -6
  98. package/src/client/app/ui/fields/VectorInput.svelte +25 -30
  99. package/src/client/app/utils/canvas.utils.js +8 -8
  100. package/src/client/app/utils/color.utils.js +46 -13
  101. package/src/client/app/utils/fields.utils.js +1 -1
  102. package/src/client/app/utils/glsl.utils.js +1 -1
  103. package/src/client/app/utils/glslErrors.js +1 -1
  104. package/src/client/main.js +2 -2
@@ -1,207 +1,92 @@
1
- <script context="module">
2
- let ID = 0;
3
- </script>
4
-
5
1
  <script>
6
- import { getContext, hasContext, onDestroy, setContext } from 'svelte';
7
- import { writable } from 'svelte/store';
8
- import {
9
- addChildren,
10
- addSibling,
11
- layout,
12
- remove,
13
- replaceChildren,
14
- swapRoot,
15
- updateModule,
16
- } from '../stores/layout';
2
+ import { getContext, setContext } from 'svelte';
3
+ import { layout } from '../state/layout.svelte';
17
4
  import Toolbar from './LayoutToolbar.svelte';
18
5
  import Resizer from './LayoutResizer.svelte';
19
- import { getModuleID } from './Module.svelte';
20
6
  import ModuleRenderer from './ModuleRenderer.svelte';
21
7
  import Preview from './Preview.svelte';
8
+ import LayoutComponent from './LayoutComponent.svelte';
22
9
 
23
- export let size = 1;
24
- export let type = 'column';
25
- export let tree = { children: [] };
26
-
27
- let parent = hasContext('parent') ? getContext('parent') : null;
28
- let depth = hasContext('depth') ? getContext('depth') + 1 : 0;
29
- let module = writable({});
30
- setContext('depth', depth);
31
- setContext('module', module);
10
+ let { id = layout.getID(), size = 1, type = 'column', children } = $props();
32
11
 
33
- let isRoot = parent === null;
34
- let children = writable([]);
35
- let style = '';
12
+ let parent = getContext('parent');
13
+ let isColumn = $derived(type === 'column');
14
+ let isRow = $derived(!isColumn);
36
15
 
37
- function createComponent({
16
+ const component = layout.createComponent({
38
17
  id,
39
- parent = null,
40
- root = false,
41
- node = null,
42
- depth,
43
- size = 1,
44
- minimized = false,
45
- type,
46
- children = [],
47
- }) {
48
- return {
49
- id,
50
- root,
51
- node,
52
- depth,
53
- size,
54
- minimized,
55
- parent: parent ? parent.id : null,
56
- type,
57
- children,
58
- };
59
- }
60
-
61
- let current = createComponent({
62
- id: !isNaN(tree.id) ? tree.id : ID++,
63
- root: isRoot,
64
- depth,
65
18
  size,
66
- parent,
19
+ origin: parent,
67
20
  type,
68
21
  });
69
22
 
70
- ID = Math.max(ID, !isNaN(current.id) ? current.id + 1 : 0);
71
-
72
- $: isColumn = type === 'column';
73
- $: isRow = !isColumn;
74
-
75
- const context = {
76
- id: current.id,
77
- children,
78
- registerChild: (child) => {
79
- $children = [...$children, child];
80
-
81
- onDestroy(() => {
82
- $children = $children.filter((c) => c !== child);
83
- });
84
- },
85
- };
86
-
87
- setContext('parent', context);
23
+ let current = $derived(layout.components.find((c) => c.id === id));
24
+ let childComponents = $derived(
25
+ current.children.map((c) => layout.getComponent(c)),
26
+ );
27
+ let minimized = $derived(current.minimized);
28
+ let isRoot = $derived(current.root);
88
29
 
89
- if (parent) {
90
- parent.registerChild(current);
91
- }
92
-
93
- if (!__BUILD__) {
94
- $layout.registerChild(current, () => $children);
95
- }
96
-
97
- $: {
98
- let property = ``,
99
- value = ``;
100
-
101
- const nodes = tree.children;
102
-
103
- if (Array.isArray(nodes) && nodes.length > 1) {
104
- if (isColumn) {
105
- property = `grid-template-rows`;
106
- value = nodes
107
- .map((row, i) => {
108
- let size = `${row.size}fr`;
109
-
110
- return `minmax(25px, ${size}) 0px`;
111
- })
112
- .join(' ');
113
- } else {
114
- property = `grid-template-columns`;
115
- value = nodes
116
- .map((col, i) => {
117
- let size = `${col.size}fr`;
118
-
119
- return `minmax(25px, ${size}) 0px`;
120
- })
121
- .join(' ');
122
- }
30
+ setContext('parent', component.id);
31
+ setContext('minimize', () => {
32
+ component.minimized = !component.minimized;
33
+ });
123
34
 
124
- style = `${property}:${value}`;
125
- } else {
126
- style = '';
127
- }
128
- }
35
+ let property = $derived(
36
+ isColumn ? `grid-template-rows` : `grid-template-columns`,
37
+ );
38
+ let value = $derived.by(() => {
39
+ const totalSize = childComponents.reduce((t, n) => t + n.size, 0);
40
+ return childComponents
41
+ .map(({ size, minimized }) =>
42
+ minimized && isColumn && !layout.editing
43
+ ? '25px 0px'
44
+ : `minmax(25px, ${(size / totalSize) * 100}%) 0px`,
45
+ )
46
+ .join(' ');
47
+ });
48
+ let style = $derived(
49
+ Array.isArray(childComponents) && childComponents.length > 0
50
+ ? `${property}:${value}`
51
+ : '',
52
+ );
129
53
 
130
54
  function addComponent(newType) {
131
- const isSibling = newType === type;
55
+ const childCount = childComponents.length;
132
56
 
133
- const newborn = createComponent({
134
- id: ID++,
135
- parent: isSibling ? parent : context,
136
- depth: isSibling ? depth : depth + 1,
57
+ layout.createComponent({
58
+ origin: current.id,
137
59
  type: newType,
138
- children: [{ mID: getModuleID(), type: 'module' }],
139
60
  });
140
61
 
141
- if (isSibling) {
142
- if (isRoot) {
143
- const newSibling = createComponent({
144
- id: ID++,
145
- depth: newborn.depth,
146
- type: newborn.type,
147
- children: current.children,
148
- });
149
-
150
- // switch type
151
- current.children = [newSibling, newborn];
152
- current.type = current.type === 'column' ? 'row' : 'column';
153
-
154
- swapRoot(current);
155
- } else {
156
- addSibling(current, newborn);
157
- }
158
- } else {
159
- if ($children.length === 1 && $children[0].type === 'module') {
160
- replaceChildren(current, [
161
- ...$children.map((c, i) =>
162
- createComponent({
163
- id: ID++,
164
- type: type === 'row' ? 'column' : 'row',
165
- depth: depth + 1,
166
- children: [c],
167
- }),
168
- ),
169
- newborn,
170
- ]);
171
-
172
- module.set({});
173
- } else {
174
- addChildren(current, newborn);
175
- }
62
+ // create a second child of new type to create divisions
63
+ // instead of a single child component which wouldn't make any visual change
64
+ if (childCount === 0 && newType !== current.type) {
65
+ layout.createComponent({
66
+ origin: current.id,
67
+ type: newType,
68
+ });
176
69
  }
177
70
  }
178
71
 
179
- function addColumn() {
180
- addComponent('column');
181
- }
182
-
183
- function addRow() {
184
- addComponent('row');
185
- }
72
+ const addColumn = () => addComponent('column');
73
+ const addRow = () => addComponent('row');
186
74
 
187
75
  function deleteCurrent() {
188
- remove(current);
189
-
190
- $children = current.children;
76
+ layout.remove(current);
191
77
  }
192
78
 
193
- function handleModuleChange(event) {
194
- const moduleName = event.detail;
195
- $children[0].name = moduleName; // keep state when replacingChildren
196
-
197
- updateModule($module, {
198
- name: moduleName,
199
- });
79
+ function handleModuleChange(moduleName) {
80
+ if (childComponents.length && childComponents[0].type === 'module') {
81
+ childComponents[0].name = moduleName; // keep state when replacingChildren
82
+ } else {
83
+ layout.createComponent({
84
+ type: 'module',
85
+ origin: current.id,
86
+ name: moduleName,
87
+ });
88
+ }
200
89
  }
201
-
202
- let offsetWidth;
203
-
204
- $: minimized = current.minimized;
205
90
  </script>
206
91
 
207
92
  <div
@@ -211,43 +96,45 @@
211
96
  class:row={isRow}
212
97
  class:minimized
213
98
  bind:this={current.node}
214
- bind:offsetWidth
99
+ data-component={component.id}
215
100
  >
216
- {#if isRoot && $layout.previewing}
101
+ {#if isRoot && layout.previewing}
217
102
  <Preview />
218
- {:else if tree && Array.isArray(tree.children) && tree.children.length > 0}
219
- {#each tree.children as child (child.id)}
103
+ {:else if childComponents.length > 0}
104
+ {#each childComponents as child (child.id)}
220
105
  {#if child.type === 'column' || child.type === 'row'}
221
- <svelte:self type={child.type} size={child.size} tree={child} />
106
+ <LayoutComponent
107
+ id={child.id}
108
+ type={child.type}
109
+ size={child.size}
110
+ />
222
111
  {:else if child.type === 'module'}
223
112
  <ModuleRenderer
113
+ id={child.id}
224
114
  name={child.name}
225
- mID={child.mID}
226
- hasHeader={child.hasHeader}
115
+ headless={child.headless}
116
+ params={child.params}
227
117
  />
118
+ {:else}
119
+ <p>Cannot render child</p>
228
120
  {/if}
229
121
  {/each}
230
122
  {:else}
231
- <slot />
123
+ {@render children()}
232
124
  {/if}
233
- {#if $layout.editing && (($children.length === 1 && $children[0].type === 'module') || isRoot)}
125
+ {#if layout.editing && (isRoot || (childComponents.length === 1 && childComponents[0].type === 'module') || childComponents.length === 0)}
234
126
  <Toolbar
235
127
  {isRoot}
236
- moduleName={$children[0].name}
237
- on:change={handleModuleChange}
238
- on:add-row={addRow}
239
- on:add-column={addColumn}
240
- on:delete={deleteCurrent}
241
- vertical={offsetWidth < 300}
128
+ moduleName={childComponents[0]?.name}
129
+ onchange={handleModuleChange}
130
+ onAddRow={addRow}
131
+ onAddColumn={addColumn}
132
+ onDelete={deleteCurrent}
242
133
  />
243
134
  {/if}
244
135
  </div>
245
136
  {#if !isRoot}
246
- <Resizer
247
- direction={isColumn ? 'vertical' : 'horizontal'}
248
- {current}
249
- {parent}
250
- />
137
+ <Resizer direction={isColumn ? 'vertical' : 'horizontal'} {current} />
251
138
  {/if}
252
139
 
253
140
  <style>
@@ -264,6 +151,10 @@
264
151
  grid-template-rows: minmax(25px, 1fr);
265
152
  }
266
153
 
154
+ .column.minimized {
155
+ height: 25px;
156
+ }
157
+
267
158
  .column:not(:last-child) {
268
159
  border-right: 0.5px solid var(--color-lightblack);
269
160
  }
@@ -8,45 +8,33 @@
8
8
  </script>
9
9
 
10
10
  <script>
11
- import { layout, resize, traverse, tree } from '../stores/layout.js';
11
+ import { layout } from '../state/layout.svelte.js';
12
12
  import { clamp, map } from '../utils/math.utils.js';
13
13
 
14
- export let direction = DIRECTIONS.HORIZONTAL;
15
- export let current;
16
- export let parent = {};
14
+ let { direction = DIRECTIONS.HORIZONTAL, current } = $props();
17
15
 
18
- const { children } = parent;
19
-
20
- let visible = false;
21
- let isDragging = false;
22
- let next;
16
+ let visible = $state(false);
17
+ let isDragging = $state(false);
18
+ let next = $state(null);
19
+ let currentRect, nextRect;
20
+ let currentSize, nextSize, totalSize;
23
21
 
24
22
  function findNext() {
25
- if (children && current.node && current.node) {
26
- const { parentNode } = current.node;
27
- const childNodes = [...parentNode.children];
28
-
29
- const index = childNodes.findIndex((c) => c === current.node);
30
- const nextNode = childNodes[index + 2];
31
-
32
- next = $children.find((c) => c.node === nextNode);
23
+ const { parent } = current;
24
+ const parentNode = layout.getComponent(parent).node;
33
25
 
34
- traverse((c) => {
35
- if (c.id === next.id) {
36
- nextSize = c.size;
37
- }
26
+ const childNodes = [...parentNode.children];
27
+ const currentNodeIndex = childNodes.findIndex(
28
+ (c) => c === current.node,
29
+ );
30
+ const nextNode = childNodes[currentNodeIndex + 2];
38
31
 
39
- if (c.id === current.id) {
40
- currentSize = c.size;
41
- }
42
- }, $tree);
43
- }
32
+ next = layout.components.find((c) => c.node === nextNode);
33
+ nextSize = next.size;
34
+ currentSize = current.size;
44
35
  }
45
36
 
46
- let currentRect, nextRect;
47
- let currentSize, nextSize, totalSize;
48
-
49
- function handleMouseDown() {
37
+ function handleMouseDown(event) {
50
38
  findNext();
51
39
 
52
40
  if (!isDragging && next) {
@@ -62,6 +50,8 @@
62
50
  nextRect = next.node.getBoundingClientRect();
63
51
 
64
52
  visible = currentSize === nextSize;
53
+
54
+ handleMouseMove(event);
65
55
  }
66
56
  }
67
57
 
@@ -134,22 +124,20 @@
134
124
  nextFlex = 0;
135
125
  }
136
126
 
137
- resize([
138
- { id: current.id, size: prevFlex },
139
- { id: next.id, size: nextFlex },
140
- ]);
127
+ current.size = prevFlex;
128
+ next.size = nextFlex;
141
129
  }
142
130
  </script>
143
131
 
144
132
  <div
145
133
  class="resizer resizer--{direction}"
146
134
  class:dragging={isDragging}
147
- class:editing={$layout.editing}
135
+ class:editing={layout.editing}
148
136
  >
149
137
  <div
150
138
  class="resizer-hover"
151
139
  class:visible
152
- on:mousedown={handleMouseDown}
140
+ onmousedown={handleMouseDown}
153
141
  ></div>
154
142
  </div>
155
143
  <svelte:window on:mouseup={handleMouseUp} on:mousemove={handleMouseMove} />
@@ -168,7 +156,7 @@
168
156
 
169
157
  .resizer-hover {
170
158
  position: absolute;
171
- z-index: 100;
159
+ z-index: 200;
172
160
 
173
161
  display: flex;
174
162
  justify-content: center;
@@ -1,11 +1,9 @@
1
1
  <script>
2
- import { tree } from '../stores/layout';
3
2
  import LayoutComponent from './LayoutComponent.svelte';
4
3
 
5
- $: type = $tree.type;
6
- $: size = $tree.size;
4
+ let { children } = $props();
7
5
  </script>
8
6
 
9
- <LayoutComponent tree={$tree} {type} {size}>
10
- <slot />
7
+ <LayoutComponent>
8
+ {@render children?.()}
11
9
  </LayoutComponent>
@@ -1,9 +1,9 @@
1
1
  <script>
2
2
  import LayoutComponent from './LayoutComponent.svelte';
3
3
 
4
- export let size = 1;
4
+ let { size = 1, children } = $props();
5
5
  </script>
6
6
 
7
7
  <LayoutComponent {size} type="row">
8
- <slot />
8
+ {@render children?.()}
9
9
  </LayoutComponent>
@@ -1,32 +1,20 @@
1
1
  <script>
2
- import { createEventDispatcher } from 'svelte';
3
2
  import IconCross from '../components/IconCross.svelte';
4
3
  import ButtonInput from './fields/ButtonInput.svelte';
5
4
  import Select from './fields/Select.svelte';
6
5
  import { moduleNames } from './ModuleRenderer.svelte';
7
6
 
8
- const defaultValue = 'Select a module';
9
-
10
- export let moduleName = undefined;
11
- export let isRoot = false;
12
- export let vertical = false;
13
-
14
- const dispatch = createEventDispatcher();
15
-
16
- let splitColumns = false;
17
- let splitRows = false;
18
-
19
- function handleAddRow() {
20
- dispatch('add-row');
21
- }
22
-
23
- function handleAddColumn() {
24
- dispatch('add-column');
25
- }
7
+ let {
8
+ moduleName,
9
+ isRoot,
10
+ vertical = false,
11
+ onAddColumn,
12
+ onAddRow,
13
+ onDelete,
14
+ onchange,
15
+ } = $props();
26
16
 
27
- function handleDelete() {
28
- dispatch('delete');
29
- }
17
+ const defaultValue = 'Select a module';
30
18
 
31
19
  const options = [
32
20
  { value: undefined, label: defaultValue, disabled: true },
@@ -34,19 +22,14 @@
34
22
  ];
35
23
  </script>
36
24
 
37
- <div
38
- class="toolbar"
39
- class:root={isRoot}
40
- class:split-columns={splitColumns}
41
- class:split-rows={splitRows}
42
- >
25
+ <div class="toolbar" class:root={isRoot}>
43
26
  <div class="content" class:vertical>
44
27
  {#if !isRoot}
45
28
  <div class="module">
46
29
  <Select
47
30
  value={moduleName}
48
31
  {options}
49
- on:change
32
+ {onchange}
50
33
  title="Switch module"
51
34
  />
52
35
  </div>
@@ -57,9 +40,7 @@
57
40
  label="Split in columns"
58
41
  showLabel={false}
59
42
  title="Split in columns"
60
- on:mouseenter={() => (splitColumns = true)}
61
- on:mouseleave={() => (splitColumns = false)}
62
- on:click={handleAddColumn}
43
+ onclick={onAddColumn}
63
44
  >
64
45
  <div class="icon-layout">
65
46
  <div class="icon-box"></div>
@@ -70,9 +51,7 @@
70
51
  label="Split in rows"
71
52
  showLabel={false}
72
53
  title="Split in rows"
73
- on:mouseenter={() => (splitRows = true)}
74
- on:mouseleave={() => (splitRows = false)}
75
- on:click={handleAddRow}
54
+ onclick={onAddRow}
76
55
  >
77
56
  <div class="icon-layout row">
78
57
  <div class="icon-box"></div>
@@ -84,7 +63,7 @@
84
63
  <ButtonInput
85
64
  label="Delete"
86
65
  showLabel={false}
87
- on:click={handleDelete}
66
+ onclick={onDelete}
88
67
  --color-text="white"
89
68
  --background-color="var(--color-red)"
90
69
  --box-shadow-color-active="var(--color-lightred)"
@@ -102,7 +81,7 @@
102
81
  position: absolute;
103
82
  top: 0;
104
83
  left: 0;
105
- /* z-index: 200; */
84
+ z-index: 100;
106
85
 
107
86
  display: grid;
108
87
  justify-content: center;
@@ -116,47 +95,9 @@
116
95
  background: rgba(0, 0, 0, 0.8);
117
96
  }
118
97
 
119
- .toolbar:after {
120
- content: '';
121
-
122
- position: absolute;
123
- right: 0;
124
- z-index: 100;
125
-
126
- width: 6px;
127
- height: 100%;
128
-
129
- background-color: rgba(255, 255, 255, 0.2);
130
- opacity: 0;
131
- pointer-events: none;
132
- transition: opacity 100ms ease;
133
- }
134
-
135
- .toolbar.split-columns:after {
136
- opacity: 1;
137
- }
138
-
139
- .toolbar:before {
140
- content: '';
141
-
142
- position: absolute;
143
- left: 0;
144
- bottom: 0;
145
-
146
- width: 100%;
147
- height: 6px;
148
-
149
- background-color: rgba(255, 255, 255, 0.2);
150
- opacity: 0;
151
- transition: opacity 100ms ease;
152
- }
153
-
154
- .toolbar.split-rows:before {
155
- opacity: 1;
156
- }
157
-
158
98
  .toolbar.root {
159
99
  align-items: flex-start;
100
+ z-index: 200;
160
101
 
161
102
  pointer-events: none;
162
103
  }