cardbuddy 0.6.0 → 0.8.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.
- package/README.md +21 -0
- package/dist/preview-editor/assets/index-BQKzMPBq.js +79 -0
- package/dist/preview-editor/assets/index-D3zp47Dg.css +1 -0
- package/dist/preview-editor/index.html +2 -2
- package/dist/server-core/cardFiles.js +9 -4
- package/dist/server-core/codeBridge.js +359 -0
- package/dist/server-core/index.js +14 -2
- package/dist/server-core/sliceUpload.js +97 -0
- package/dist/standalone.js +18 -3
- package/dist/vendored/App.vue +268 -45
- package/dist/vendored/api.js +102 -32
- package/dist/vendored/assets/svgIcons/icons.svg +5 -0
- package/dist/vendored/components/ApiCallPanel.vue +127 -0
- package/dist/vendored/components/ApiPayloadTree.vue +34 -1
- package/dist/vendored/components/CardGallery.vue +2 -0
- package/dist/vendored/components/CardSelect.vue +6 -0
- package/dist/vendored/components/ComponentPalette.vue +45 -38
- package/dist/vendored/components/ConfirmDialog.vue +20 -5
- package/dist/vendored/components/DebugPanel.vue +168 -127
- package/dist/vendored/components/EventEditor.vue +27 -3
- package/dist/vendored/components/JsonTree.vue +35 -4
- package/dist/vendored/components/LogValue.vue +2 -1
- package/dist/vendored/components/PropControl.vue +6 -2
- package/dist/vendored/components/StructureTree.vue +53 -2
- package/dist/vendored/components/setters/SetCode.vue +111 -3
- package/dist/vendored/styles/app.css +507 -132
- package/dist/vendored/styles/card-gallery.css +23 -2
- package/dist/vendored/styles/card-select.css +15 -0
- package/dist/vendored/styles/dropdown.css +3 -0
- package/dist/vendored/styles/json-tree.css +1 -1
- package/dist/vendored/styles/node-inspector.css +176 -119
- package/dist/vendored/styles/setters.css +91 -2
- package/dist/vendored/styles/structure-tree.css +158 -15
- package/package.json +1 -1
- package/dist/preview-editor/assets/index-BYB0hngG.js +0 -72
- package/dist/preview-editor/assets/index-CpBZEQDy.css +0 -1
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
background: var(--bg-input);
|
|
221
221
|
border-left: 1px solid var(--border);
|
|
222
222
|
color: var(--text-dim);
|
|
223
|
-
font-size:
|
|
223
|
+
font-size: 12px;
|
|
224
224
|
line-height: 1;
|
|
225
225
|
cursor: pointer;
|
|
226
226
|
user-select: none;
|
|
@@ -309,7 +309,7 @@
|
|
|
309
309
|
background: var(--accent);
|
|
310
310
|
}
|
|
311
311
|
.st-switch__text {
|
|
312
|
-
font-size:
|
|
312
|
+
font-size: 12px;
|
|
313
313
|
color: var(--text-dim);
|
|
314
314
|
}
|
|
315
315
|
|
|
@@ -763,12 +763,31 @@
|
|
|
763
763
|
/* --------------------------- 代码编辑器(SetCode) --------------------------- */
|
|
764
764
|
|
|
765
765
|
.st-code {
|
|
766
|
+
position: relative;
|
|
766
767
|
display: flex;
|
|
767
768
|
flex-direction: column;
|
|
768
769
|
gap: 4px;
|
|
769
770
|
min-width: 0;
|
|
770
771
|
}
|
|
771
772
|
|
|
773
|
+
/* 代码编辑器右上角语言标签:等宽小字 + 发丝线框的弱化标识,不挡交互 */
|
|
774
|
+
.st-code__lang {
|
|
775
|
+
position: absolute;
|
|
776
|
+
top: 6px;
|
|
777
|
+
right: 8px;
|
|
778
|
+
padding: 0 5px;
|
|
779
|
+
border: 1px solid var(--border);
|
|
780
|
+
border-radius: 4px;
|
|
781
|
+
background: var(--bg-bar);
|
|
782
|
+
color: var(--text-faint);
|
|
783
|
+
font-family: 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
|
|
784
|
+
font-size: 10px;
|
|
785
|
+
line-height: 16px;
|
|
786
|
+
letter-spacing: 0.4px;
|
|
787
|
+
pointer-events: none;
|
|
788
|
+
user-select: none;
|
|
789
|
+
}
|
|
790
|
+
|
|
772
791
|
.st-code__editor {
|
|
773
792
|
min-height: 140px;
|
|
774
793
|
max-height: 340px;
|
|
@@ -796,6 +815,76 @@
|
|
|
796
815
|
pointer-events: none;
|
|
797
816
|
}
|
|
798
817
|
|
|
818
|
+
/* 桥接期间只读:边框着淡 accent 提示「外部编辑中」,不用 opacity 压暗(与 disabled 区分) */
|
|
819
|
+
.st-code__editor.is-bridged {
|
|
820
|
+
border-color: var(--accent-border);
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
/* 底栏右侧动作组:VSCode 桥接按钮 + 同步徽标(与左侧行数 hint 两端对齐) */
|
|
824
|
+
.st-code__foot-actions {
|
|
825
|
+
flex: 0 0 auto;
|
|
826
|
+
margin-left: auto;
|
|
827
|
+
display: inline-flex;
|
|
828
|
+
align-items: center;
|
|
829
|
+
gap: 8px;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
.st-code__bridge-tag {
|
|
833
|
+
font-size: 11px;
|
|
834
|
+
color: var(--accent);
|
|
835
|
+
white-space: nowrap;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
/* 文字+图标弱按钮:与 .ee-help / 面板关闭按钮同一语言(22px 高、无边框、hover 浅底) */
|
|
839
|
+
.st-code__vscode {
|
|
840
|
+
flex: 0 0 auto;
|
|
841
|
+
height: 22px;
|
|
842
|
+
display: inline-flex;
|
|
843
|
+
align-items: center;
|
|
844
|
+
justify-content: center;
|
|
845
|
+
gap: 4px;
|
|
846
|
+
padding: 0 5px;
|
|
847
|
+
background: none;
|
|
848
|
+
border: none;
|
|
849
|
+
border-radius: 6px;
|
|
850
|
+
color: var(--text-faint);
|
|
851
|
+
font-size: 11px;
|
|
852
|
+
line-height: normal;
|
|
853
|
+
white-space: nowrap;
|
|
854
|
+
cursor: pointer;
|
|
855
|
+
transition: color 0.15s, background 0.15s;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
.st-code__vscode-label {
|
|
859
|
+
font-size: 11px;
|
|
860
|
+
line-height: normal;
|
|
861
|
+
letter-spacing: 0.2px;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
.st-code__vscode:hover {
|
|
865
|
+
color: var(--text);
|
|
866
|
+
background: var(--bg-hover);
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
.st-code__vscode.is-on {
|
|
870
|
+
color: var(--accent);
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
.st-code__vscode.is-on:hover {
|
|
874
|
+
background: var(--accent-soft);
|
|
875
|
+
color: var(--accent);
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
.st-code__vscode:disabled {
|
|
879
|
+
opacity: 0.5;
|
|
880
|
+
cursor: not-allowed;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
.st-code__vscode svg {
|
|
884
|
+
display: block;
|
|
885
|
+
fill: currentColor;
|
|
886
|
+
}
|
|
887
|
+
|
|
799
888
|
.st-code__foot {
|
|
800
889
|
display: flex;
|
|
801
890
|
align-items: center;
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
.st {
|
|
9
9
|
position: relative;
|
|
10
10
|
min-height: 100%;
|
|
11
|
+
/* flex 列布局 + 底部帮助按钮 margin-top:auto:内容不足一屏时按钮仍吸附面板底部 */
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
11
14
|
}
|
|
12
15
|
|
|
13
16
|
/* 顶部工具条:与 JsonTree 的 .jt__toolbar 同款(sticky 顶部),
|
|
@@ -16,7 +19,7 @@
|
|
|
16
19
|
display: flex;
|
|
17
20
|
justify-content: flex-start;
|
|
18
21
|
gap: 12px;
|
|
19
|
-
padding:
|
|
22
|
+
padding: 8px 12px;
|
|
20
23
|
position: sticky;
|
|
21
24
|
top: 0;
|
|
22
25
|
z-index: var(--z-sticky);
|
|
@@ -86,14 +89,148 @@
|
|
|
86
89
|
list-style: none;
|
|
87
90
|
}
|
|
88
91
|
|
|
89
|
-
/*
|
|
90
|
-
|
|
92
|
+
/* 帮助悬浮按钮容器:零高度 sticky 吸附在滚动视口底部(滚动容器为外层 .debug__body),
|
|
93
|
+
内容过长时按钮仍固定于面板左下角可见,且不占用固定布局区域 */
|
|
94
|
+
.st__help-wrap {
|
|
95
|
+
position: sticky;
|
|
96
|
+
bottom: 10px;
|
|
97
|
+
height: 0;
|
|
98
|
+
z-index: var(--z-pop);
|
|
99
|
+
/* 内容较短时把按钮推到 .st 底部(即面板可见区底部);内容较长时由 sticky 吸附兜底 */
|
|
100
|
+
margin-top: auto;
|
|
101
|
+
}
|
|
102
|
+
.st__help {
|
|
103
|
+
position: absolute;
|
|
104
|
+
left: 10px;
|
|
105
|
+
bottom: 0;
|
|
106
|
+
display: inline-flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
width: 28px;
|
|
110
|
+
height: 28px;
|
|
111
|
+
padding: 0;
|
|
112
|
+
background: var(--bg-input);
|
|
113
|
+
color: var(--text-dim);
|
|
114
|
+
border: 1px solid var(--border-strong);
|
|
115
|
+
border-radius: 50%;
|
|
116
|
+
cursor: pointer;
|
|
117
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
|
|
118
|
+
transition: background 0.15s, color 0.15s, border-color 0.15s;
|
|
119
|
+
}
|
|
120
|
+
.st__help svg {
|
|
121
|
+
transition: transform 0.05s;
|
|
122
|
+
}
|
|
123
|
+
.st__help:hover {
|
|
124
|
+
background: var(--bg-hover);
|
|
125
|
+
border-color: var(--accent-border);
|
|
126
|
+
color: var(--accent);
|
|
127
|
+
}
|
|
128
|
+
/* 按压反馈下移到内部图标:按钮本身是零高度 sticky 容器内的绝对定位元素,
|
|
129
|
+
其 transform 会按 sticky 未吸附时的静态位置(即内容最底部)计入 .debug__body
|
|
130
|
+
的可滚动溢出,按下时多出 1px 溢出导致面板主体闪现滚动条;图标在 28px 按钮内
|
|
131
|
+
上下各有 6px 余量,1px 位移不会外溢。 */
|
|
132
|
+
.st__help:active svg {
|
|
133
|
+
transform: translateY(1px);
|
|
134
|
+
}
|
|
135
|
+
/* 气泡展开时按钮保持激活态配色 */
|
|
136
|
+
.st__help--open {
|
|
137
|
+
background: var(--accent-soft);
|
|
138
|
+
border-color: var(--accent-border);
|
|
139
|
+
color: var(--accent);
|
|
140
|
+
}
|
|
141
|
+
/* 使用说明气泡:自左下角按钮向上弹出 */
|
|
142
|
+
.st__help-pop {
|
|
143
|
+
position: absolute;
|
|
144
|
+
left: 10px;
|
|
145
|
+
bottom: 36px;
|
|
146
|
+
width: 300px;
|
|
147
|
+
background: var(--bg-panel);
|
|
148
|
+
border: 1px solid var(--border-strong);
|
|
149
|
+
border-radius: 10px;
|
|
150
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
|
|
151
|
+
}
|
|
152
|
+
.st__help-pop-head {
|
|
153
|
+
display: flex;
|
|
154
|
+
align-items: center;
|
|
155
|
+
justify-content: space-between;
|
|
156
|
+
padding: 8px 12px;
|
|
157
|
+
border-bottom: 1px solid var(--border);
|
|
158
|
+
}
|
|
159
|
+
.st__help-pop-title {
|
|
160
|
+
font-size: 12px;
|
|
161
|
+
font-weight: 600;
|
|
162
|
+
color: var(--text);
|
|
163
|
+
}
|
|
164
|
+
.st__help-pop-close {
|
|
165
|
+
display: inline-flex;
|
|
166
|
+
align-items: center;
|
|
167
|
+
justify-content: center;
|
|
168
|
+
width: 18px;
|
|
169
|
+
height: 18px;
|
|
170
|
+
padding: 0;
|
|
171
|
+
background: none;
|
|
172
|
+
border: none;
|
|
173
|
+
color: var(--text-faint);
|
|
174
|
+
font-size: 12px;
|
|
175
|
+
cursor: pointer;
|
|
176
|
+
border-radius: 4px;
|
|
177
|
+
transition: background 0.15s, color 0.15s;
|
|
178
|
+
}
|
|
179
|
+
.st__help-pop-close:hover {
|
|
180
|
+
background: var(--bg-hover);
|
|
181
|
+
color: var(--text);
|
|
182
|
+
}
|
|
183
|
+
.st__help-pop-body {
|
|
91
184
|
margin: 0;
|
|
92
|
-
padding:
|
|
185
|
+
padding: 10px 12px;
|
|
186
|
+
color: var(--text-dim);
|
|
187
|
+
font-size: 12px;
|
|
188
|
+
line-height: 1.6;
|
|
189
|
+
}
|
|
190
|
+
/* 快捷键清单:左列按键示意(kbd 芯片),右列一句话说明 */
|
|
191
|
+
.st__keys {
|
|
192
|
+
list-style: none;
|
|
193
|
+
display: flex;
|
|
194
|
+
flex-direction: column;
|
|
195
|
+
gap: 8px;
|
|
196
|
+
}
|
|
197
|
+
.st__keys-row {
|
|
198
|
+
display: flex;
|
|
199
|
+
align-items: center;
|
|
200
|
+
gap: 10px;
|
|
201
|
+
}
|
|
202
|
+
.st__keys-combo {
|
|
203
|
+
flex: 0 0 108px; /* 左列固定宽度,组合键纵向对齐 */
|
|
204
|
+
display: inline-flex;
|
|
205
|
+
align-items: center;
|
|
206
|
+
gap: 3px;
|
|
207
|
+
white-space: nowrap;
|
|
208
|
+
}
|
|
209
|
+
.st__kbd {
|
|
210
|
+
display: inline-flex;
|
|
211
|
+
align-items: center;
|
|
212
|
+
justify-content: center;
|
|
213
|
+
min-width: 20px;
|
|
214
|
+
height: 20px;
|
|
215
|
+
padding: 0 5px;
|
|
216
|
+
background: var(--bg-input);
|
|
217
|
+
color: var(--text);
|
|
218
|
+
border: 1px solid var(--border-strong);
|
|
219
|
+
border-bottom-width: 2px; /* 键帽底部加厚,模拟按键立体感 */
|
|
220
|
+
border-radius: 5px;
|
|
221
|
+
font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
|
|
222
|
+
font-size: 11px;
|
|
223
|
+
line-height: 1;
|
|
224
|
+
}
|
|
225
|
+
.st__kbd-plus {
|
|
93
226
|
color: var(--text-faint);
|
|
94
227
|
font-size: 11px;
|
|
228
|
+
}
|
|
229
|
+
.st__keys-desc {
|
|
230
|
+
flex: 1 1 auto;
|
|
231
|
+
color: var(--text-dim);
|
|
232
|
+
font-size: 12px;
|
|
95
233
|
line-height: 1.5;
|
|
96
|
-
border-bottom: 1px solid var(--border);
|
|
97
234
|
}
|
|
98
235
|
|
|
99
236
|
.st__node {
|
|
@@ -216,30 +353,36 @@
|
|
|
216
353
|
margin-left: auto;
|
|
217
354
|
padding: 0 6px;
|
|
218
355
|
font-size: 11px;
|
|
219
|
-
line-height:
|
|
220
|
-
|
|
221
|
-
background: var(--st-badge-bg);
|
|
356
|
+
line-height: 16px;
|
|
357
|
+
border: 1px solid transparent;
|
|
222
358
|
border-radius: var(--radius-xs);
|
|
223
359
|
}
|
|
224
360
|
|
|
361
|
+
/* 有事件:soft 语言(浅底 + 同色文字 + 发丝描边),与面板内分段 / 来源切换一致,
|
|
362
|
+
不再用实心蓝块;hover 仅提亮文字,不做缩放 / 透明度旧语言 */
|
|
225
363
|
.st__badge--clickable {
|
|
364
|
+
color: var(--accent);
|
|
365
|
+
background: var(--accent-soft);
|
|
366
|
+
border-color: var(--accent-border);
|
|
226
367
|
cursor: pointer;
|
|
227
|
-
transition:
|
|
368
|
+
transition: color 0.15s, background 0.15s, border-color 0.15s;
|
|
228
369
|
}
|
|
229
370
|
.st__badge--clickable:hover {
|
|
230
|
-
|
|
231
|
-
transform: scale(1.05);
|
|
371
|
+
color: var(--accent-hover);
|
|
232
372
|
}
|
|
373
|
+
|
|
374
|
+
/* 无事件:透明底 + 发丝线框的弱标识 */
|
|
233
375
|
.st__badge--muted {
|
|
234
376
|
cursor: pointer;
|
|
235
|
-
background: var(--border-strong);
|
|
236
377
|
color: var(--text-faint);
|
|
237
|
-
|
|
238
|
-
|
|
378
|
+
background: transparent;
|
|
379
|
+
border-color: var(--border);
|
|
380
|
+
transition: opacity 0.15s, color 0.15s, background 0.15s, border-color 0.15s;
|
|
239
381
|
}
|
|
240
382
|
.st__badge--muted:hover {
|
|
241
|
-
opacity: 1;
|
|
242
383
|
color: var(--text-dim);
|
|
384
|
+
background: var(--bg-hover);
|
|
385
|
+
border-color: var(--border-strong);
|
|
243
386
|
}
|
|
244
387
|
|
|
245
388
|
/* 行最右侧「齿轮」:打开节点属性面板(替代原双击行为)。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cardbuddy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Local dev service for the CardBuddy card editor — decouples card CRUD (sync/save/validate/render-status/screenshot) from the static public editor, so the editor can be deployed to any static host while each developer runs a local service against their own card source.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|