@bagelink/vue 1.2.11 → 1.2.15

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/dist/style.css CHANGED
@@ -55,62 +55,62 @@
55
55
  text-decoration: underline;
56
56
  }
57
57
 
58
- .bgl_btn[data-v-b609e748] {
58
+ .bgl_btn[data-v-99c4aa53] {
59
59
  --btn-bg: var(--bgl-primary);
60
60
  --btn-color: var(--bgl-light-text);
61
61
  --btn-flat-color: var(--bgl-text-color);
62
62
  }
63
- .bgl_btn-green[data-v-b609e748] {
63
+ .bgl_btn-green[data-v-99c4aa53] {
64
64
  --btn-bg: var(--bgl-green);
65
65
  --btn-color: var(--bgl-light-text);
66
66
  --btn-flat-color: var(--bgl-green);
67
67
  }
68
- .bgl_btn-yellow[data-v-b609e748] {
68
+ .bgl_btn-yellow[data-v-99c4aa53] {
69
69
  --btn-bg: var(--bgl-yellow);
70
70
  --btn-color: var(--bgl-black);
71
71
  --btn-flat-color: var(--bgl-yellow);
72
72
  }
73
- .bgl_btn-blue[data-v-b609e748] {
73
+ .bgl_btn-blue[data-v-99c4aa53] {
74
74
  --btn-bg: var(--bgl-blue);
75
75
  --btn-color: var(--bgl-light-text);
76
76
  --btn-flat-color: var(--bgl-blue);
77
77
  }
78
- .bgl_btn-primary[data-v-b609e748] {
78
+ .bgl_btn-primary[data-v-99c4aa53] {
79
79
  --btn-bg: var(--bgl-primary);
80
80
  --btn-color: var(--bgl-light-text);
81
81
  --btn-flat-color: var(--bgl-primary);
82
82
  }
83
- .bgl_btn-red[data-v-b609e748] {
83
+ .bgl_btn-red[data-v-99c4aa53] {
84
84
  --btn-bg: var(--bgl-red);
85
85
  --btn-color: var(--bgl-light-text);
86
86
  --btn-flat-color: var(--bgl-red);
87
87
  }
88
- .bgl_btn-white[data-v-b609e748] {
88
+ .bgl_btn-white[data-v-99c4aa53] {
89
89
  --btn-bg: var(--bgl-white);
90
90
  --btn-color: var(--bgl-black);
91
91
  --btn-flat-color: var(--bgl-white);
92
92
  }
93
- .bgl_btn-black[data-v-b609e748] {
93
+ .bgl_btn-black[data-v-99c4aa53] {
94
94
  --btn-bg: var(--bgl-black);
95
95
  --btn-color: var(--bgl-light-text);
96
96
  --btn-flat-color: var(--bgl-black);
97
97
  }
98
- .bgl_btn-gray[data-v-b609e748] {
98
+ .bgl_btn-gray[data-v-99c4aa53] {
99
99
  --btn-bg: var(--bgl-gray-light);
100
100
  --btn-color: var(--bgl-black);
101
101
  --btn-flat-color: var(--bgl-gray);
102
102
  }
103
- .bgl_btn-light[data-v-b609e748] {
103
+ .bgl_btn-light[data-v-99c4aa53] {
104
104
  --btn-bg: var(--bgl-primary-light);
105
105
  --btn-color: var(--bgl-primary);
106
106
  --btn-flat-color: var(--bgl-primary-light);
107
107
  }
108
- .bgl_btn-gray-light[data-v-b609e748] {
108
+ .bgl_btn-gray-light[data-v-99c4aa53] {
109
109
  --btn-bg: var(--bgl-gray-light);
110
110
  --btn-color: var(--bgl-gray);
111
111
  --btn-flat-color: var(--bgl-gray-light);
112
112
  }
113
- .bgl_btn[data-v-b609e748] {
113
+ .bgl_btn[data-v-99c4aa53] {
114
114
  padding-left: var(--btn-padding);
115
115
  padding-right: var(--btn-padding);
116
116
  transition: var(--bgl-transition);
@@ -118,7 +118,7 @@
118
118
  color: var(--btn-color);
119
119
  text-decoration: none;
120
120
  }
121
- .bgl_btn.bgl_btn-icon[data-v-b609e748] {
121
+ .bgl_btn.bgl_btn-icon[data-v-99c4aa53] {
122
122
  padding-left: 0;
123
123
  padding-right: 0;
124
124
  height: var(--btn-height);
@@ -127,72 +127,72 @@
127
127
  font-size: 1rem;
128
128
  flex-shrink: 0;
129
129
  }
130
- a[data-v-b609e748] {
130
+ a[data-v-99c4aa53] {
131
131
  text-decoration: none;
132
132
  }
133
- .bgl_btn-flex[data-v-b609e748] {
133
+ .bgl_btn-flex[data-v-99c4aa53] {
134
134
  display: flex;
135
135
  align-items: center;
136
136
  gap: 0.5rem;
137
137
  justify-content: center;
138
138
  height: 100%;
139
139
  }
140
- .bgl_btn .bgl_btn-icon[data-v-b609e748]{
140
+ .bgl_btn .bgl_btn-icon[data-v-99c4aa53]{
141
141
  font-size: calc(var(--input-font-size) * 1.3);
142
142
  }
143
- .bgl_btn[data-v-b609e748]:hover,
144
- .bgl_btn-icon[data-v-b609e748]:hover {
143
+ .bgl_btn[data-v-99c4aa53]:hover,
144
+ .bgl_btn-icon[data-v-99c4aa53]:hover {
145
145
  filter: var(--bgl-hover-filter);
146
146
  }
147
- .bgl_btn[data-v-b609e748]:active:not(:disabled),
148
- .bgl_btn-icon[data-v-b609e748]:active:not(:disabled) {
147
+ .bgl_btn[data-v-99c4aa53]:active:not(:disabled),
148
+ .bgl_btn-icon[data-v-99c4aa53]:active:not(:disabled) {
149
149
  filter: var(--bgl-active-filter);
150
150
  }
151
- .bgl_btn.bgl_btn_flat[data-v-b609e748] {
151
+ .bgl_btn.bgl_btn_flat[data-v-99c4aa53] {
152
152
  background: transparent;
153
153
  color: var(--btn-flat-color);
154
154
  }
155
- .bgl_btn_flat[data-v-b609e748]:hover:not(:disabled),
156
- .bgl_btn-icon.bgl_btn_flat[data-v-b609e748]:hover:not(:disabled) {
155
+ .bgl_btn_flat[data-v-99c4aa53]:hover:not(:disabled),
156
+ .bgl_btn-icon.bgl_btn_flat[data-v-99c4aa53]:hover:not(:disabled) {
157
157
  background: var(--bgl-gray-20);
158
158
  }
159
- .bgl_btn.bgl_btn_flat[data-v-b609e748]:active:not(:disabled),
160
- .bgl_btn-icon.bgl_btn_flat[data-v-b609e748]:active:not(:disabled) {
159
+ .bgl_btn.bgl_btn_flat[data-v-99c4aa53]:active:not(:disabled),
160
+ .bgl_btn-icon.bgl_btn_flat[data-v-99c4aa53]:active:not(:disabled) {
161
161
  background: var(--bgl-gray-40);
162
162
  }
163
- .bgl_btn.thin[data-v-b609e748] {
163
+ .bgl_btn.thin[data-v-99c4aa53] {
164
164
  padding-inline: calc(var(--btn-padding) / 3);
165
165
  border-radius: calc(var(--btn-border-radius) / 1.5);
166
166
  }
167
- .bgl_btn.round[data-v-b609e748] {
167
+ .bgl_btn.round[data-v-99c4aa53] {
168
168
  border-radius: 1000px;
169
169
  }
170
- .bgl_btn-icon.thin[data-v-b609e748] {
170
+ .bgl_btn-icon.thin[data-v-99c4aa53] {
171
171
  height: calc(var(--btn-height) / 1.5);
172
172
  width: calc(var(--btn-height) / 1.5);
173
173
  line-height: normal;
174
174
  }
175
- .bgl_btn-icon.thin .bgl_btn-flex[data-v-b609e748] {
175
+ .bgl_btn-icon.thin .bgl_btn-flex[data-v-99c4aa53] {
176
176
  height: 100%;
177
177
  }
178
- [dir="rtl"] .bgl_btn-icon[data-v-b609e748]{
178
+ [dir="rtl"] .bgl_btn-icon[data-v-99c4aa53]{
179
179
  transform: rotateY(180deg);
180
180
  }
181
- [dir="rtl"] .ltr .bgl_btn-icon[data-v-b609e748]{
181
+ [dir="rtl"] .ltr .bgl_btn-icon[data-v-99c4aa53]{
182
182
  transform: rotateY(0deg);
183
183
  }
184
- .bgl_btn-border[data-v-b609e748], .bgl_btn-icon.bgl_btn_flat.bgl_btn-border[data-v-b609e748] {
184
+ .bgl_btn-border[data-v-99c4aa53], .bgl_btn-icon.bgl_btn_flat.bgl_btn-border[data-v-99c4aa53] {
185
185
  border: 1px solid var(--btn-flat-color);
186
186
  background: transparent;
187
187
  color: var(--btn-flat-color);
188
188
  }
189
- .bgl_btn-border[data-v-b609e748]:hover {
189
+ .bgl_btn-border[data-v-99c4aa53]:hover {
190
190
  color: var(--btn-flat-color);
191
191
  }
192
- .bgl_btn-border[data-v-b609e748]:active:not(:disabled) {
192
+ .bgl_btn-border[data-v-99c4aa53]:active:not(:disabled) {
193
193
  filter: brightness(80%);
194
194
  }
195
- .bgl_btn[data-v-b609e748]:disabled, .bgl_btn[disabled=true][data-v-b609e748] {
195
+ .bgl_btn[data-v-99c4aa53]:disabled, .bgl_btn[disabled=true][data-v-99c4aa53] {
196
196
  opacity: 0.7;
197
197
  filter: grayscale(0.3);
198
198
  cursor: not-allowed;
@@ -2011,7 +2011,7 @@ input[type="range"][data-v-46e22f3e]:active::-webkit-slider-thumb {
2011
2011
  }
2012
2012
  }
2013
2013
 
2014
- .tableBoxSelect[data-v-4548b70f]::after {
2014
+ .tableBoxSelect[data-v-2f424c9c]::after {
2015
2015
  content: '';
2016
2016
  display: block;
2017
2017
  width: calc(100% - 4px);
@@ -2019,12 +2019,12 @@ input[type="range"][data-v-46e22f3e]:active::-webkit-slider-thumb {
2019
2019
  border: 1px solid var(--bgl-gray);
2020
2020
  background: var(--bgl-gray-light);
2021
2021
  }
2022
- .borderSelect[data-v-4548b70f]::after {
2022
+ .borderSelect[data-v-2f424c9c]::after {
2023
2023
  border-color: var(--bgl-primary-tint);
2024
2024
  background: var(--bgl-primary-light);
2025
2025
  }
2026
2026
 
2027
- .toolbar[data-v-9d8a6eb6] .active {
2027
+ .toolbar[data-v-7e9466dc] .active {
2028
2028
  background: var(--bgl-primary);
2029
2029
  color: white;
2030
2030
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "1.2.11",
4
+ "version": "1.2.15",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -42,6 +42,7 @@ const props = withDefaults(
42
42
  )
43
43
 
44
44
  const isComponent = $computed(() => {
45
+ if (props.disabled) return props.is
45
46
  if (props.to) return RouterLink
46
47
  if (props.href) return 'a'
47
48
  return props.is
@@ -49,8 +50,10 @@ const isComponent = $computed(() => {
49
50
 
50
51
  const bind = $computed(() => {
51
52
  const obj: { [key: string]: any } = {}
52
- if (props.to && !props.disabled) obj.to = props.to
53
- else if (props.href && !props.disabled) obj.href = props.href
53
+ if (!props.disabled) {
54
+ if (props.to) obj.to = props.to
55
+ else if (props.href) obj.href = props.href
56
+ }
54
57
  if (!props.to && !props.href) {
55
58
  obj.role = props.role
56
59
  obj.type = props.type
@@ -7,7 +7,7 @@ import type {
7
7
  BglFormSchemaFnT,
8
8
  Field,
9
9
  } from '@bagelink/vue'
10
- import { BagelForm, Btn, Loading } from '@bagelink/vue'
10
+ import { BagelForm, Btn, Loading, Icon } from '@bagelink/vue'
11
11
  import { ref, onMounted, computed, watch } from 'vue'
12
12
 
13
13
  const props = withDefaults(
@@ -23,10 +23,9 @@ function runAction(name: ToolbarConfigOption, value?: string) {
23
23
  <Dropdown v-if="action.name === 'insertTable'" placement="bottom-start" thin flat icon="table">
24
24
  <template #default="{ hide }">
25
25
  <GridBox
26
- :gridSize="5" @select="$event => {
27
- runAction('insertTable', $event);
28
- ($event.target as any)?.blur();
29
- hide()
26
+ :gridSize="5" @select="(value) => {
27
+ runAction('insertTable', value);
28
+ hide();
30
29
  }"
31
30
  />
32
31
  </template>
@@ -1,7 +1,10 @@
1
1
  <script setup lang="ts">
2
+ const props = defineProps<{
3
+ gridSize?: number
4
+ }>()
2
5
  const emit = defineEmits(['select'])
3
6
  const fb = 1
4
- const base = 5
7
+ const base = props.gridSize || 5
5
8
  const hoveredRow = $ref(fb)
6
9
  const hoveredCol = $ref(fb)
7
10
 
@@ -7,13 +7,19 @@ export function useCommands(state: EditorState, debug?: { logCommand: (command:
7
7
 
8
8
  return {
9
9
  execute: (command: string, value?: string) => {
10
- if (!state.doc) return
10
+ console.log(`[useCommands] Executing command: ${command}`, value ? `with value: ${value}` : '')
11
+
12
+ if (!state.doc) {
13
+ console.log('[useCommands] No document available, skipping command')
14
+ return
15
+ }
11
16
 
12
17
  // Log command if debug is enabled
13
18
  debug?.logCommand(command, value)
14
19
 
15
20
  // Handle view state commands directly
16
21
  if (['splitView', 'codeView', 'fullScreen'].includes(command)) {
22
+ console.log(`[useCommands] Handling view state command: ${command}`)
17
23
  switch (command) {
18
24
  case 'splitView':
19
25
  state.isSplitView = !state.isSplitView
@@ -28,14 +34,26 @@ export function useCommands(state: EditorState, debug?: { logCommand: (command:
28
34
  }
29
35
 
30
36
  // Focus the editor before executing command
31
- state.doc.body.focus()
37
+ try {
38
+ state.doc.body.focus()
39
+ console.log('[useCommands] Editor focused')
40
+ } catch (e) {
41
+ console.error('[useCommands] Error focusing editor:', e)
42
+ }
32
43
 
33
44
  // Execute the command
34
- executor.execute(command, value)
45
+ try {
46
+ console.log('[useCommands] Executing command via executor')
47
+ executor.execute(command, value)
48
+ console.log('[useCommands] Command execution completed')
49
+ } catch (e) {
50
+ console.error('[useCommands] Error during command execution:', e)
51
+ }
35
52
 
36
53
  // Update content state only if it has changed
37
54
  const newContent = state.doc.body.innerHTML
38
55
  if (newContent !== state.content) {
56
+ console.log('[useCommands] Content changed, updating state')
39
57
  state.content = newContent
40
58
  }
41
59
 
@@ -47,6 +65,7 @@ export function useCommands(state: EditorState, debug?: { logCommand: (command:
47
65
  || state.rangeCount !== selection.rangeCount
48
66
 
49
67
  if (hasSelectionChanged) {
68
+ console.log('[useCommands] Selection changed, updating state')
50
69
  state.selection = selection
51
70
  state.range = selection.getRangeAt(0).cloneRange()
52
71
  state.rangeCount = selection.rangeCount
@@ -102,13 +102,15 @@ export const toolbarOptions: ToolbarOption[] = [
102
102
  { name: 'fontColor', label: 'Font Color', icon: 'format_color_text' },
103
103
  { name: 'bgColor', label: 'Background Color', icon: 'format_color_fill' },
104
104
  { name: 'insertTable', label: 'Insert Table', icon: 'table' },
105
- { name: 'deleteTable', label: 'Delete Table', icon: 'table_rows' },
106
- { name: 'insertRowAbove', label: 'Insert Row Above', icon: 'table_rows' },
107
- { name: 'insertRowBelow', label: 'Insert Row Below', icon: 'table_rows' },
108
- { name: 'deleteRow', label: 'Delete Row', icon: 'table_rows' },
109
- { name: 'insertColumnLeft', label: 'Insert Column Left', icon: 'add_column_left' },
110
- { name: 'insertColumnRight', label: 'Insert Column Right', icon: 'add_column_right' },
111
- { name: 'deleteColumn', label: 'Delete Column', icon: 'view_column' },
105
+ { name: 'deleteTable', label: 'Delete Table', icon: 'delete_sweep' },
106
+ { name: 'mergeCells', label: 'Merge Cells', icon: 'table_chart' },
107
+ { name: 'splitCells', label: 'Split Cells', icon: 'dashboard' },
108
+ { name: 'addRowBefore', label: 'Insert Row Above', icon: 'add_box' },
109
+ { name: 'addRowAfter', label: 'Insert Row Below', icon: 'vertical_align_bottom' },
110
+ { name: 'deleteRow', label: 'Delete Row', icon: 'remove' },
111
+ { name: 'insertColumnLeft', label: 'Insert Column Left', icon: 'format_indent_decrease' },
112
+ { name: 'insertColumnRight', label: 'Insert Column Right', icon: 'format_indent_increase' },
113
+ { name: 'deleteColumn', label: 'Delete Column', icon: 'view_week' },
112
114
  { name: 'separator' },
113
115
  { name: 'undo', label: 'Undo', icon: 'undo' },
114
116
  { name: 'redo', label: 'Redo', icon: 'redo' },