@shwfed/config 2.3.3 → 2.3.5
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/module.json +1 -1
- package/dist/runtime/components/actions/components/group.d.vue.ts +12 -10
- package/dist/runtime/components/actions/components/group.vue +47 -13
- package/dist/runtime/components/actions/components/group.vue.d.ts +12 -10
- package/dist/runtime/components/actions/config.d.vue.ts +13 -11
- package/dist/runtime/components/actions/config.vue +252 -35
- package/dist/runtime/components/actions/config.vue.d.ts +13 -11
- package/dist/runtime/components/actions/items/2026-05-21/com.shwfed.actions.item.markdown/config.d.vue.ts +37 -0
- package/dist/runtime/components/actions/items/2026-05-21/com.shwfed.actions.item.markdown/config.vue +61 -0
- package/dist/runtime/components/actions/items/2026-05-21/com.shwfed.actions.item.markdown/config.vue.d.ts +37 -0
- package/dist/runtime/components/actions/items/2026-05-21/com.shwfed.actions.item.markdown/runtime.d.vue.ts +7 -0
- package/dist/runtime/components/actions/items/2026-05-21/com.shwfed.actions.item.markdown/runtime.vue +22 -0
- package/dist/runtime/components/actions/items/2026-05-21/com.shwfed.actions.item.markdown/runtime.vue.d.ts +7 -0
- package/dist/runtime/components/actions/items/2026-05-21/com.shwfed.actions.item.markdown/schema.d.ts +23 -0
- package/dist/runtime/components/actions/items/2026-05-21/com.shwfed.actions.item.markdown/schema.js +29 -0
- package/dist/runtime/components/actions/schema.d.ts +400 -193
- package/dist/runtime/components/actions/schema.js +22 -4
- package/dist/runtime/components/actions/utils/resolve.d.ts +15 -0
- package/dist/runtime/components/actions/utils/resolve.js +45 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.actions/config.d.vue.ts +10 -8
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.actions/config.vue.d.ts +10 -8
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.actions/runtime.d.vue.ts +10 -8
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.actions/runtime.vue.d.ts +10 -8
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.actions/schema.d.ts +115 -57
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +10 -8
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +10 -8
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +10 -8
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +10 -8
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +120 -61
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/config.d.vue.ts +10 -8
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/config.vue.d.ts +10 -8
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/schema.d.ts +115 -57
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.actions/schema.d.ts +115 -57
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/runtime.vue +4 -4
- package/dist/runtime/components/table/schema.d.ts +125 -65
- package/dist/runtime/components/table/utils/row-reorder.js +16 -5
- package/dist/runtime/vendor/cel-js/CLAUDE.md +5 -1
- package/dist/runtime/vendor/cel-js/PROMPT.md +19 -0
- package/dist/runtime/vendor/cel-js/lib/evaluator.js +2 -0
- package/dist/runtime/vendor/cel-js/lib/form-builtins.d.ts +2 -0
- package/dist/runtime/vendor/cel-js/lib/form-builtins.js +58 -0
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./schema";
|
|
10
10
|
import { Environment } from "../../vendor/cel-js/lib/index";
|
|
11
11
|
import { provideCELContext } from "../../utils/cel-context";
|
|
12
|
-
import { BUTTONS, findButton } from "./utils/resolve";
|
|
12
|
+
import { BUTTONS, findButton, ITEMS, findItem } from "./utils/resolve";
|
|
13
13
|
import { SIDEBAR_TAKEOVER_KEY } from "../sidebar-takeover";
|
|
14
14
|
import { BREADCRUMB_EXTENSION_KEY } from "../config/breadcrumb-extension";
|
|
15
15
|
import { ScrollArea } from "../ui/scroll-area";
|
|
@@ -87,6 +87,12 @@ const generalFieldDescription = (f) => getStructFieldDescription(actionsSchema,
|
|
|
87
87
|
function isDropdownItem(item) {
|
|
88
88
|
return "items" in item;
|
|
89
89
|
}
|
|
90
|
+
function isRegistryItem(item) {
|
|
91
|
+
return "type" in item && "compatibilityDate" in item;
|
|
92
|
+
}
|
|
93
|
+
function isRegistrySub(child) {
|
|
94
|
+
return "type" in child && "compatibilityDate" in child;
|
|
95
|
+
}
|
|
90
96
|
const GROUP_DRAG_KIND = "group";
|
|
91
97
|
const ITEM_DRAG_KIND = "item";
|
|
92
98
|
const SUBITEM_DRAG_KIND = "sub";
|
|
@@ -102,6 +108,12 @@ const SIZE_OPTIONS = [
|
|
|
102
108
|
{ value: "sm", label: "\u5C0F" },
|
|
103
109
|
{ value: "xs", label: "\u6781\u5C0F" }
|
|
104
110
|
];
|
|
111
|
+
const ITEM_PICKER_ENTRIES = ITEMS.map((i) => ({
|
|
112
|
+
type: i.type,
|
|
113
|
+
compatibilityDate: i.compatibilityDate,
|
|
114
|
+
name: i.metadata.name,
|
|
115
|
+
icon: i.metadata.icon
|
|
116
|
+
})).sort((a, b) => a.name.localeCompare(b.name, "zh"));
|
|
105
117
|
const ACTION_PICKER_ENTRIES = (() => {
|
|
106
118
|
const byType = /* @__PURE__ */ new Map();
|
|
107
119
|
for (const a of BUTTONS) {
|
|
@@ -162,12 +174,36 @@ function itemsOfGroup(groupId) {
|
|
|
162
174
|
return editingItems.value.filter((it) => it.groupId === groupId);
|
|
163
175
|
}
|
|
164
176
|
function itemLabel(item) {
|
|
177
|
+
if (isRegistryItem(item)) {
|
|
178
|
+
const entry = findItem(item.type, item.compatibilityDate);
|
|
179
|
+
const candidate = item.name;
|
|
180
|
+
if (typeof candidate === "string" && candidate.trim().length > 0) return candidate;
|
|
181
|
+
return entry ? `\u672A\u547D\u540D${entry.metadata.name}` : "\u672A\u547D\u540D\u9879";
|
|
182
|
+
}
|
|
165
183
|
const fallback = isDropdownItem(item) ? "\u672A\u547D\u540D\u4E0B\u62C9\u6309\u94AE" : "\u672A\u547D\u540D\u6309\u94AE";
|
|
166
184
|
return getLocalizedText(item.title, "zh") ?? fallback;
|
|
167
185
|
}
|
|
186
|
+
function itemIcon(item) {
|
|
187
|
+
if (isRegistryItem(item)) {
|
|
188
|
+
return findItem(item.type, item.compatibilityDate)?.metadata.icon;
|
|
189
|
+
}
|
|
190
|
+
return item.icon;
|
|
191
|
+
}
|
|
168
192
|
function subLabel(sub) {
|
|
193
|
+
if (isRegistrySub(sub)) {
|
|
194
|
+
const entry = findItem(sub.type, sub.compatibilityDate);
|
|
195
|
+
const candidate = sub.name;
|
|
196
|
+
if (typeof candidate === "string" && candidate.trim().length > 0) return candidate;
|
|
197
|
+
return entry ? `\u672A\u547D\u540D${entry.metadata.name}` : "\u672A\u547D\u540D\u9879";
|
|
198
|
+
}
|
|
169
199
|
return getLocalizedText(sub.title, "zh") ?? "\u672A\u547D\u540D\u6309\u94AE";
|
|
170
200
|
}
|
|
201
|
+
function subIcon(sub) {
|
|
202
|
+
if (isRegistrySub(sub)) {
|
|
203
|
+
return findItem(sub.type, sub.compatibilityDate)?.metadata.icon;
|
|
204
|
+
}
|
|
205
|
+
return sub.icon;
|
|
206
|
+
}
|
|
171
207
|
function composeGroupLabel(groupId) {
|
|
172
208
|
const items = itemsOfGroup(groupId);
|
|
173
209
|
if (items.length === 0) return "";
|
|
@@ -176,7 +212,7 @@ function composeGroupLabel(groupId) {
|
|
|
176
212
|
if (items.length === 2) return `${first}\u3001${itemLabel(items[1])}`;
|
|
177
213
|
return `${first} \u7B49 ${items.length} \u4E2A\u6309\u94AE`;
|
|
178
214
|
}
|
|
179
|
-
function
|
|
215
|
+
function findItemNode(id) {
|
|
180
216
|
return editingItems.value.find((it) => it.id === id) ?? null;
|
|
181
217
|
}
|
|
182
218
|
function findSub(id) {
|
|
@@ -197,22 +233,46 @@ const selectedGroup = computed(() => {
|
|
|
197
233
|
});
|
|
198
234
|
const selectedActionItem = computed(() => {
|
|
199
235
|
if (selected.value?.kind !== "item") return null;
|
|
200
|
-
const it =
|
|
201
|
-
if (!it || isDropdownItem(it)) return null;
|
|
236
|
+
const it = findItemNode(selected.value.id);
|
|
237
|
+
if (!it || isDropdownItem(it) || isRegistryItem(it)) return null;
|
|
202
238
|
return it;
|
|
203
239
|
});
|
|
204
240
|
const selectedDropdownItem = computed(() => {
|
|
205
241
|
if (selected.value?.kind !== "item") return null;
|
|
206
|
-
const it =
|
|
242
|
+
const it = findItemNode(selected.value.id);
|
|
207
243
|
if (!it || !isDropdownItem(it)) return null;
|
|
208
244
|
return it;
|
|
209
245
|
});
|
|
246
|
+
const selectedRegistryItem = computed(() => {
|
|
247
|
+
if (selected.value?.kind !== "item") return null;
|
|
248
|
+
const it = findItemNode(selected.value.id);
|
|
249
|
+
if (!it || !isRegistryItem(it)) return null;
|
|
250
|
+
return it;
|
|
251
|
+
});
|
|
252
|
+
const selectedRegistryEntry = computed(() => {
|
|
253
|
+
const it = selectedRegistryItem.value;
|
|
254
|
+
if (!it) return null;
|
|
255
|
+
return findItem(it.type, it.compatibilityDate) ?? null;
|
|
256
|
+
});
|
|
210
257
|
const selectedSubRef = computed(() => {
|
|
211
258
|
if (selected.value?.kind !== "sub") return null;
|
|
212
|
-
|
|
259
|
+
const found = findSub(selected.value.id);
|
|
260
|
+
if (!found || isRegistrySub(found.sub)) return null;
|
|
261
|
+
return found.sub;
|
|
262
|
+
});
|
|
263
|
+
const selectedRegistrySub = computed(() => {
|
|
264
|
+
if (selected.value?.kind !== "sub") return null;
|
|
265
|
+
const found = findSub(selected.value.id);
|
|
266
|
+
if (!found || !isRegistrySub(found.sub)) return null;
|
|
267
|
+
return found.sub;
|
|
268
|
+
});
|
|
269
|
+
const selectedRegistrySubEntry = computed(() => {
|
|
270
|
+
const sub = selectedRegistrySub.value;
|
|
271
|
+
if (!sub) return null;
|
|
272
|
+
return findItem(sub.type, sub.compatibilityDate) ?? null;
|
|
213
273
|
});
|
|
214
274
|
const hasSelection = computed(
|
|
215
|
-
() => selectedGeneral.value || selectedGroup.value !== null || selectedActionItem.value !== null || selectedDropdownItem.value !== null || selectedSubRef.value !== null
|
|
275
|
+
() => selectedGeneral.value || selectedGroup.value !== null || selectedActionItem.value !== null || selectedDropdownItem.value !== null || selectedRegistryItem.value !== null || selectedSubRef.value !== null || selectedRegistrySub.value !== null
|
|
216
276
|
);
|
|
217
277
|
function setOptionalString(target, key, value) {
|
|
218
278
|
if (value.trim() === "") Reflect.deleteProperty(target, key);
|
|
@@ -275,6 +335,21 @@ function patchSelectedActionItem(mutate) {
|
|
|
275
335
|
if (!touched) return;
|
|
276
336
|
commit(w);
|
|
277
337
|
}
|
|
338
|
+
function patchSelectedRegistryItem(next) {
|
|
339
|
+
const sel = selected.value;
|
|
340
|
+
if (sel?.kind !== "item") return;
|
|
341
|
+
const id = sel.id;
|
|
342
|
+
if (next.id !== id) return;
|
|
343
|
+
const w = snapshot();
|
|
344
|
+
let touched = false;
|
|
345
|
+
w.items = w.items.map((it) => {
|
|
346
|
+
if (it.id !== id || !isRegistryItem(it)) return it;
|
|
347
|
+
touched = true;
|
|
348
|
+
return next;
|
|
349
|
+
});
|
|
350
|
+
if (!touched) return;
|
|
351
|
+
commit(w);
|
|
352
|
+
}
|
|
278
353
|
function patchSelectedDropdownItem(mutate) {
|
|
279
354
|
const sel = selected.value;
|
|
280
355
|
if (sel?.kind !== "item") return;
|
|
@@ -303,7 +378,7 @@ function patchSelectedSub(mutate) {
|
|
|
303
378
|
return {
|
|
304
379
|
...it,
|
|
305
380
|
items: it.items.map((s) => {
|
|
306
|
-
if (s.id !== id) return s;
|
|
381
|
+
if (s.id !== id || isRegistrySub(s)) return s;
|
|
307
382
|
const next = { ...s };
|
|
308
383
|
mutate(next);
|
|
309
384
|
touched = true;
|
|
@@ -314,6 +389,28 @@ function patchSelectedSub(mutate) {
|
|
|
314
389
|
if (!touched) return;
|
|
315
390
|
commit(w);
|
|
316
391
|
}
|
|
392
|
+
function patchSelectedRegistrySub(next) {
|
|
393
|
+
const sel = selected.value;
|
|
394
|
+
if (sel?.kind !== "sub") return;
|
|
395
|
+
const id = sel.id;
|
|
396
|
+
if (next.id !== id) return;
|
|
397
|
+
const w = snapshot();
|
|
398
|
+
let touched = false;
|
|
399
|
+
w.items = w.items.map((it) => {
|
|
400
|
+
if (!isDropdownItem(it)) return it;
|
|
401
|
+
if (!it.items.some((s) => s.id === id)) return it;
|
|
402
|
+
return {
|
|
403
|
+
...it,
|
|
404
|
+
items: it.items.map((s) => {
|
|
405
|
+
if (s.id !== id || !isRegistrySub(s)) return s;
|
|
406
|
+
touched = true;
|
|
407
|
+
return next;
|
|
408
|
+
})
|
|
409
|
+
};
|
|
410
|
+
});
|
|
411
|
+
if (!touched) return;
|
|
412
|
+
commit(w);
|
|
413
|
+
}
|
|
317
414
|
function isDrillableAction(action) {
|
|
318
415
|
if (!action) return false;
|
|
319
416
|
return findButton(action.type, action.compatibilityDate)?.metadata.drillable === true;
|
|
@@ -430,10 +527,18 @@ function subItemToActionItem(sub, groupId) {
|
|
|
430
527
|
if (s.action !== void 0) out.action = s.action;
|
|
431
528
|
return out;
|
|
432
529
|
}
|
|
530
|
+
function registryItemToSub(it) {
|
|
531
|
+
const { groupId: _drop, ...rest } = it;
|
|
532
|
+
return rest;
|
|
533
|
+
}
|
|
534
|
+
function registrySubToItem(sub, groupId) {
|
|
535
|
+
return { ...sub, groupId };
|
|
536
|
+
}
|
|
433
537
|
function materializeAsSubItems(items, kind, id) {
|
|
434
538
|
if (kind === ITEM_DRAG_KIND) {
|
|
435
539
|
const it = items.find((i) => i.id === id);
|
|
436
540
|
if (!it || isDropdownItem(it)) return [];
|
|
541
|
+
if (isRegistryItem(it)) return [registryItemToSub(it)];
|
|
437
542
|
return [actionItemToSubItem(it)];
|
|
438
543
|
}
|
|
439
544
|
if (kind === SUBITEM_DRAG_KIND) {
|
|
@@ -452,7 +557,9 @@ function materializeAsTopLevel(items, kind, id, groupId) {
|
|
|
452
557
|
if (kind === SUBITEM_DRAG_KIND) {
|
|
453
558
|
const parent = findParentDropdownOfSub(items, id);
|
|
454
559
|
const sub = parent?.items.find((s) => s.id === id);
|
|
455
|
-
|
|
560
|
+
if (!sub) return null;
|
|
561
|
+
if (isRegistrySub(sub)) return registrySubToItem(sub, groupId);
|
|
562
|
+
return subItemToActionItem(sub, groupId);
|
|
456
563
|
}
|
|
457
564
|
return null;
|
|
458
565
|
}
|
|
@@ -589,6 +696,28 @@ function addButton(type, compatibilityDate) {
|
|
|
589
696
|
commit(w);
|
|
590
697
|
selected.value = { kind: "item", id: itemId };
|
|
591
698
|
}
|
|
699
|
+
function seedItemValue(type) {
|
|
700
|
+
if (type === "com.shwfed.actions.item.markdown") {
|
|
701
|
+
return { name: "", content: emptyLocale() };
|
|
702
|
+
}
|
|
703
|
+
return {};
|
|
704
|
+
}
|
|
705
|
+
function addItem(type, compatibilityDate) {
|
|
706
|
+
const groupId = crypto.randomUUID();
|
|
707
|
+
const itemId = crypto.randomUUID();
|
|
708
|
+
const newItem = {
|
|
709
|
+
id: itemId,
|
|
710
|
+
groupId,
|
|
711
|
+
type,
|
|
712
|
+
compatibilityDate,
|
|
713
|
+
...seedItemValue(type)
|
|
714
|
+
};
|
|
715
|
+
const w = snapshot();
|
|
716
|
+
w.groups = [...w.groups, { id: groupId }];
|
|
717
|
+
w.items = [...w.items, newItem];
|
|
718
|
+
commit(w);
|
|
719
|
+
selected.value = { kind: "item", id: itemId };
|
|
720
|
+
}
|
|
592
721
|
function promoteToNewGroup(sourceKind, sourceId, groupInsertIndex) {
|
|
593
722
|
if (sourceKind === GROUP_DRAG_KIND) return;
|
|
594
723
|
const w = snapshot();
|
|
@@ -623,7 +752,7 @@ function resolveSelection() {
|
|
|
623
752
|
const s = selected.value;
|
|
624
753
|
if (!s || s.kind === "general") return;
|
|
625
754
|
if (s.kind === "group" && findGroup(s.id)) return;
|
|
626
|
-
if (s.kind === "item" &&
|
|
755
|
+
if (s.kind === "item" && findItemNode(s.id)) return;
|
|
627
756
|
if (s.kind === "sub" && findSub(s.id)) return;
|
|
628
757
|
selected.value = { kind: "general" };
|
|
629
758
|
}
|
|
@@ -874,13 +1003,14 @@ const newGroupZoneId = (insertIndex) => `new-group-${insertIndex}`;
|
|
|
874
1003
|
class="drag-handle size-4 shrink-0 cursor-grab text-zinc-300"
|
|
875
1004
|
/>
|
|
876
1005
|
<Icon
|
|
877
|
-
v-if="item
|
|
878
|
-
:icon="item
|
|
1006
|
+
v-if="itemIcon(item)"
|
|
1007
|
+
:icon="itemIcon(item)"
|
|
879
1008
|
class="size-4 shrink-0"
|
|
1009
|
+
:class="isRegistryItem(item) ? 'text-purple-500' : void 0"
|
|
880
1010
|
/>
|
|
881
1011
|
<span class="flex-1 truncate">{{ itemLabel(item) }}</span>
|
|
882
1012
|
<Tooltip
|
|
883
|
-
v-if="!isDropdownItem(item)"
|
|
1013
|
+
v-if="!isDropdownItem(item) && !isRegistryItem(item)"
|
|
884
1014
|
:delay-duration="180"
|
|
885
1015
|
>
|
|
886
1016
|
<TooltipTrigger as-child>
|
|
@@ -911,7 +1041,7 @@ const newGroupZoneId = (insertIndex) => `new-group-${insertIndex}`;
|
|
|
911
1041
|
</button>
|
|
912
1042
|
</TooltipTrigger>
|
|
913
1043
|
<TooltipContent side="right">
|
|
914
|
-
{{ isDropdownItem(item) ? "\u5220\u9664\u8BE5\u4E0B\u62C9\u6309\u94AE\u53CA\u5176\u6240\u6709\u4E0B\u62C9\u9879" : "\u5220\u9664\u8BE5\u6309\u94AE" }}
|
|
1044
|
+
{{ isDropdownItem(item) ? "\u5220\u9664\u8BE5\u4E0B\u62C9\u6309\u94AE\u53CA\u5176\u6240\u6709\u4E0B\u62C9\u9879" : isRegistryItem(item) ? "\u5220\u9664\u8BE5\u9879" : "\u5220\u9664\u8BE5\u6309\u94AE" }}
|
|
915
1045
|
</TooltipContent>
|
|
916
1046
|
</Tooltip>
|
|
917
1047
|
</div>
|
|
@@ -933,9 +1063,10 @@ const newGroupZoneId = (insertIndex) => `new-group-${insertIndex}`;
|
|
|
933
1063
|
class="drag-handle size-4 shrink-0 cursor-grab text-zinc-300"
|
|
934
1064
|
/>
|
|
935
1065
|
<Icon
|
|
936
|
-
v-if="sub
|
|
937
|
-
:icon="sub
|
|
1066
|
+
v-if="subIcon(sub)"
|
|
1067
|
+
:icon="subIcon(sub)"
|
|
938
1068
|
class="size-4 shrink-0"
|
|
1069
|
+
:class="isRegistrySub(sub) ? 'text-purple-500' : void 0"
|
|
939
1070
|
/>
|
|
940
1071
|
<span class="flex-1 truncate">{{ subLabel(sub) }}</span>
|
|
941
1072
|
<Tooltip :delay-duration="180">
|
|
@@ -989,6 +1120,19 @@ const newGroupZoneId = (insertIndex) => `new-group-${insertIndex}`;
|
|
|
989
1120
|
<span class="flex-1">{{ entry.name }}</span>
|
|
990
1121
|
<span class="ml-auto text-xs tabular-nums text-zinc-400">{{ entry.compatibilityDate }}</span>
|
|
991
1122
|
</CommandItem>
|
|
1123
|
+
<CommandItem
|
|
1124
|
+
v-for="entry in ITEM_PICKER_ENTRIES"
|
|
1125
|
+
:key="entry.type"
|
|
1126
|
+
:value="entry.type"
|
|
1127
|
+
@select="addItem(entry.type, entry.compatibilityDate)"
|
|
1128
|
+
>
|
|
1129
|
+
<Icon
|
|
1130
|
+
:icon="entry.icon"
|
|
1131
|
+
class="size-4 shrink-0 text-purple-500"
|
|
1132
|
+
/>
|
|
1133
|
+
<span class="flex-1">{{ entry.name }}</span>
|
|
1134
|
+
<span class="ml-auto text-xs tabular-nums text-zinc-400">{{ entry.compatibilityDate }}</span>
|
|
1135
|
+
</CommandItem>
|
|
992
1136
|
</CommandGroup>
|
|
993
1137
|
</InputGroupCombobox>
|
|
994
1138
|
</InputGroup>
|
|
@@ -1133,6 +1277,29 @@ const newGroupZoneId = (insertIndex) => `new-group-${insertIndex}`;
|
|
|
1133
1277
|
</Field>
|
|
1134
1278
|
</div>
|
|
1135
1279
|
|
|
1280
|
+
<div
|
|
1281
|
+
v-else-if="selectedRegistryItem"
|
|
1282
|
+
class="flex flex-col gap-4 p-6"
|
|
1283
|
+
>
|
|
1284
|
+
<component
|
|
1285
|
+
:is="selectedRegistryEntry?.config"
|
|
1286
|
+
v-if="selectedRegistryEntry"
|
|
1287
|
+
:model-value="selectedRegistryItem"
|
|
1288
|
+
@update:model-value="(v) => patchSelectedRegistryItem(v)"
|
|
1289
|
+
/>
|
|
1290
|
+
<div
|
|
1291
|
+
v-else
|
|
1292
|
+
class="flex items-start gap-2 rounded border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800"
|
|
1293
|
+
role="alert"
|
|
1294
|
+
>
|
|
1295
|
+
<Icon
|
|
1296
|
+
icon="fluent:warning-20-regular"
|
|
1297
|
+
class="mt-px size-4 shrink-0"
|
|
1298
|
+
/>
|
|
1299
|
+
<span class="flex-1">未找到匹配的项目类型:{{ selectedRegistryItem.type }}@{{ selectedRegistryItem.compatibilityDate }}</span>
|
|
1300
|
+
</div>
|
|
1301
|
+
</div>
|
|
1302
|
+
|
|
1136
1303
|
<div
|
|
1137
1304
|
v-else-if="selectedDropdownItem"
|
|
1138
1305
|
class="flex flex-col gap-4 p-6"
|
|
@@ -1159,25 +1326,52 @@ const newGroupZoneId = (insertIndex) => `new-group-${insertIndex}`;
|
|
|
1159
1326
|
/>
|
|
1160
1327
|
</Field>
|
|
1161
1328
|
|
|
1162
|
-
<
|
|
1163
|
-
<
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
>
|
|
1168
|
-
<
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1329
|
+
<div class="flex items-end gap-4">
|
|
1330
|
+
<Field
|
|
1331
|
+
orientation="vertical"
|
|
1332
|
+
class="flex-1"
|
|
1333
|
+
>
|
|
1334
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
1335
|
+
<template
|
|
1336
|
+
v-if="dropdownItemFieldDescription('icon')"
|
|
1337
|
+
#tooltip
|
|
1338
|
+
>
|
|
1339
|
+
<Markdown
|
|
1340
|
+
:source="dropdownItemFieldDescription('icon')"
|
|
1341
|
+
block
|
|
1342
|
+
class="prose prose-sm prose-zinc"
|
|
1343
|
+
/>
|
|
1344
|
+
</template>
|
|
1345
|
+
{{ dropdownItemFieldTitle("icon") }}
|
|
1346
|
+
</FieldLabel>
|
|
1347
|
+
<IconPicker
|
|
1348
|
+
:model-value="selectedDropdownItem.icon ?? ''"
|
|
1349
|
+
@update:model-value="(v) => patchSelectedDropdownItem((it) => setOptionalString(it, 'icon', v))"
|
|
1350
|
+
/>
|
|
1351
|
+
</Field>
|
|
1352
|
+
<Field
|
|
1353
|
+
orientation="horizontal"
|
|
1354
|
+
class="h-9 w-auto gap-2"
|
|
1355
|
+
>
|
|
1356
|
+
<Switch
|
|
1357
|
+
:model-value="selectedDropdownItem.hideTitle ?? false"
|
|
1358
|
+
@update:model-value="(v) => patchSelectedDropdownItem((it) => setOptionalBoolean(it, 'hideTitle', v))"
|
|
1359
|
+
/>
|
|
1360
|
+
<FieldLabel class="text-sm text-zinc-600">
|
|
1361
|
+
<template
|
|
1362
|
+
v-if="dropdownItemFieldDescription('hideTitle')"
|
|
1363
|
+
#tooltip
|
|
1364
|
+
>
|
|
1365
|
+
<Markdown
|
|
1366
|
+
:source="dropdownItemFieldDescription('hideTitle')"
|
|
1367
|
+
block
|
|
1368
|
+
class="prose prose-sm prose-zinc"
|
|
1369
|
+
/>
|
|
1370
|
+
</template>
|
|
1371
|
+
{{ dropdownItemFieldTitle("hideTitle") }}
|
|
1372
|
+
</FieldLabel>
|
|
1373
|
+
</Field>
|
|
1374
|
+
</div>
|
|
1181
1375
|
|
|
1182
1376
|
<p class="text-xs text-zinc-400">
|
|
1183
1377
|
下拉按钮的下拉项以独立行的形式编辑,选中任意下拉项即可修改其属性。
|
|
@@ -1588,6 +1782,29 @@ const newGroupZoneId = (insertIndex) => `new-group-${insertIndex}`;
|
|
|
1588
1782
|
/>
|
|
1589
1783
|
</template>
|
|
1590
1784
|
</div>
|
|
1785
|
+
|
|
1786
|
+
<div
|
|
1787
|
+
v-else-if="selectedRegistrySub"
|
|
1788
|
+
class="flex flex-col gap-4 p-6"
|
|
1789
|
+
>
|
|
1790
|
+
<component
|
|
1791
|
+
:is="selectedRegistrySubEntry?.config"
|
|
1792
|
+
v-if="selectedRegistrySubEntry"
|
|
1793
|
+
:model-value="selectedRegistrySub"
|
|
1794
|
+
@update:model-value="(v) => patchSelectedRegistrySub(v)"
|
|
1795
|
+
/>
|
|
1796
|
+
<div
|
|
1797
|
+
v-else
|
|
1798
|
+
class="flex items-start gap-2 rounded border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800"
|
|
1799
|
+
role="alert"
|
|
1800
|
+
>
|
|
1801
|
+
<Icon
|
|
1802
|
+
icon="fluent:warning-20-regular"
|
|
1803
|
+
class="mt-px size-4 shrink-0"
|
|
1804
|
+
/>
|
|
1805
|
+
<span class="flex-1">未找到匹配的项目类型:{{ selectedRegistrySub.type }}@{{ selectedRegistrySub.compatibilityDate }}</span>
|
|
1806
|
+
</div>
|
|
1807
|
+
</div>
|
|
1591
1808
|
</ScrollArea>
|
|
1592
1809
|
</div>
|
|
1593
1810
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ActionsConfigValue } from './schema.js';
|
|
1
|
+
import { type ActionsConfigValue, type RegistryItemValue, type RegistrySubItemValue } from './schema.js';
|
|
2
2
|
import { Environment } from '../../vendor/cel-js/lib/index.js';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
configure?: (env: Environment) => void;
|
|
@@ -7,9 +7,9 @@ type __VLS_ModelProps = {
|
|
|
7
7
|
'modelValue': ActionsConfigValue;
|
|
8
8
|
};
|
|
9
9
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
10
|
-
declare var
|
|
10
|
+
declare var __VLS_196: {};
|
|
11
11
|
type __VLS_Slots = {} & {
|
|
12
|
-
'general-extra'?: (props: typeof
|
|
12
|
+
'general-extra'?: (props: typeof __VLS_196) => any;
|
|
13
13
|
};
|
|
14
14
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
15
|
"update:modelValue": (value: {
|
|
@@ -17,7 +17,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
17
17
|
readonly style?: string | undefined;
|
|
18
18
|
readonly gap: number;
|
|
19
19
|
readonly kind: "shwfed.component.action";
|
|
20
|
-
readonly items: readonly ({
|
|
20
|
+
readonly items: readonly (RegistryItemValue | {
|
|
21
21
|
readonly disabled?: string | undefined;
|
|
22
22
|
readonly id: string;
|
|
23
23
|
readonly title: readonly [{
|
|
@@ -50,8 +50,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
50
50
|
readonly message: string;
|
|
51
51
|
}[]];
|
|
52
52
|
readonly icon?: string | undefined;
|
|
53
|
-
readonly
|
|
54
|
-
readonly items: readonly {
|
|
53
|
+
readonly items: readonly (RegistrySubItemValue | {
|
|
55
54
|
readonly disabled?: string | undefined;
|
|
56
55
|
readonly id: string;
|
|
57
56
|
readonly title: readonly [{
|
|
@@ -72,7 +71,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
72
71
|
}[]] | undefined;
|
|
73
72
|
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
74
73
|
readonly action?: any;
|
|
75
|
-
}[];
|
|
74
|
+
})[];
|
|
75
|
+
readonly groupId: string;
|
|
76
|
+
readonly hideTitle?: boolean | undefined;
|
|
76
77
|
})[];
|
|
77
78
|
readonly groups: readonly {
|
|
78
79
|
readonly id: string;
|
|
@@ -85,7 +86,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
85
86
|
readonly style?: string | undefined;
|
|
86
87
|
readonly gap: number;
|
|
87
88
|
readonly kind: "shwfed.component.action";
|
|
88
|
-
readonly items: readonly ({
|
|
89
|
+
readonly items: readonly (RegistryItemValue | {
|
|
89
90
|
readonly disabled?: string | undefined;
|
|
90
91
|
readonly id: string;
|
|
91
92
|
readonly title: readonly [{
|
|
@@ -118,8 +119,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
118
119
|
readonly message: string;
|
|
119
120
|
}[]];
|
|
120
121
|
readonly icon?: string | undefined;
|
|
121
|
-
readonly
|
|
122
|
-
readonly items: readonly {
|
|
122
|
+
readonly items: readonly (RegistrySubItemValue | {
|
|
123
123
|
readonly disabled?: string | undefined;
|
|
124
124
|
readonly id: string;
|
|
125
125
|
readonly title: readonly [{
|
|
@@ -140,7 +140,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
140
140
|
}[]] | undefined;
|
|
141
141
|
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
142
142
|
readonly action?: any;
|
|
143
|
-
}[];
|
|
143
|
+
})[];
|
|
144
|
+
readonly groupId: string;
|
|
145
|
+
readonly hideTitle?: boolean | undefined;
|
|
144
146
|
})[];
|
|
145
147
|
readonly groups: readonly {
|
|
146
148
|
readonly id: string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type Value } from './schema.js';
|
|
2
|
+
type __VLS_ModelProps = {
|
|
3
|
+
modelValue: Value;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
"update:modelValue": (value: {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly type: "com.shwfed.actions.item.markdown";
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly content: readonly [{
|
|
11
|
+
readonly locale: "zh";
|
|
12
|
+
readonly message: string;
|
|
13
|
+
}, ...{
|
|
14
|
+
readonly locale: "en" | "ja" | "ko";
|
|
15
|
+
readonly message: string;
|
|
16
|
+
}[]];
|
|
17
|
+
readonly compatibilityDate: "2026-05-21";
|
|
18
|
+
readonly groupId?: string | undefined;
|
|
19
|
+
}) => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
21
|
+
"onUpdate:modelValue"?: ((value: {
|
|
22
|
+
readonly name: string;
|
|
23
|
+
readonly type: "com.shwfed.actions.item.markdown";
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly content: readonly [{
|
|
26
|
+
readonly locale: "zh";
|
|
27
|
+
readonly message: string;
|
|
28
|
+
}, ...{
|
|
29
|
+
readonly locale: "en" | "ja" | "ko";
|
|
30
|
+
readonly message: string;
|
|
31
|
+
}[]];
|
|
32
|
+
readonly compatibilityDate: "2026-05-21";
|
|
33
|
+
readonly groupId?: string | undefined;
|
|
34
|
+
}) => any) | undefined;
|
|
35
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
declare const _default: typeof __VLS_export;
|
|
37
|
+
export default _default;
|
package/dist/runtime/components/actions/items/2026-05-21/com.shwfed.actions.item.markdown/config.vue
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { Field, FieldLabel } from "../../../../ui/field";
|
|
3
|
+
import { Input } from "../../../../ui/input";
|
|
4
|
+
import { Locale as LocaleField } from "../../../../ui/locale";
|
|
5
|
+
import { Markdown } from "../../../../ui/markdown";
|
|
6
|
+
import { getStructFieldDescription, getStructFieldTitle } from "../../../schema";
|
|
7
|
+
import { schema } from "./schema";
|
|
8
|
+
defineOptions({ name: "ShwfedMarkdownItemConfig" });
|
|
9
|
+
const value = defineModel({ type: null, ...{ required: true } });
|
|
10
|
+
const itemSchema = schema(() => {
|
|
11
|
+
});
|
|
12
|
+
const fieldTitle = (f) => getStructFieldTitle(itemSchema, f) ?? f;
|
|
13
|
+
const fieldDescription = (f) => getStructFieldDescription(itemSchema, f);
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<div class="flex flex-col gap-4">
|
|
18
|
+
<Field orientation="vertical">
|
|
19
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
20
|
+
<template
|
|
21
|
+
v-if="fieldDescription('name')"
|
|
22
|
+
#tooltip
|
|
23
|
+
>
|
|
24
|
+
<Markdown
|
|
25
|
+
:source="fieldDescription('name')"
|
|
26
|
+
block
|
|
27
|
+
class="prose prose-sm prose-zinc"
|
|
28
|
+
/>
|
|
29
|
+
</template>
|
|
30
|
+
{{ fieldTitle("name") }}
|
|
31
|
+
</FieldLabel>
|
|
32
|
+
<Input
|
|
33
|
+
:model-value="value.name"
|
|
34
|
+
placeholder="仅用于编辑器内识别"
|
|
35
|
+
@update:model-value="(v) => value = { ...value, name: String(v) }"
|
|
36
|
+
/>
|
|
37
|
+
</Field>
|
|
38
|
+
|
|
39
|
+
<Field orientation="vertical">
|
|
40
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
41
|
+
<template
|
|
42
|
+
v-if="fieldDescription('content')"
|
|
43
|
+
#tooltip
|
|
44
|
+
>
|
|
45
|
+
<Markdown
|
|
46
|
+
:source="fieldDescription('content')"
|
|
47
|
+
block
|
|
48
|
+
class="prose prose-sm prose-zinc"
|
|
49
|
+
/>
|
|
50
|
+
</template>
|
|
51
|
+
{{ fieldTitle("content") }}
|
|
52
|
+
</FieldLabel>
|
|
53
|
+
<LocaleField
|
|
54
|
+
markdown
|
|
55
|
+
multiline
|
|
56
|
+
:model-value="value.content"
|
|
57
|
+
@update:model-value="(v) => value = { ...value, content: v }"
|
|
58
|
+
/>
|
|
59
|
+
</Field>
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type Value } from './schema.js';
|
|
2
|
+
type __VLS_ModelProps = {
|
|
3
|
+
modelValue: Value;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
"update:modelValue": (value: {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly type: "com.shwfed.actions.item.markdown";
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly content: readonly [{
|
|
11
|
+
readonly locale: "zh";
|
|
12
|
+
readonly message: string;
|
|
13
|
+
}, ...{
|
|
14
|
+
readonly locale: "en" | "ja" | "ko";
|
|
15
|
+
readonly message: string;
|
|
16
|
+
}[]];
|
|
17
|
+
readonly compatibilityDate: "2026-05-21";
|
|
18
|
+
readonly groupId?: string | undefined;
|
|
19
|
+
}) => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
21
|
+
"onUpdate:modelValue"?: ((value: {
|
|
22
|
+
readonly name: string;
|
|
23
|
+
readonly type: "com.shwfed.actions.item.markdown";
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly content: readonly [{
|
|
26
|
+
readonly locale: "zh";
|
|
27
|
+
readonly message: string;
|
|
28
|
+
}, ...{
|
|
29
|
+
readonly locale: "en" | "ja" | "ko";
|
|
30
|
+
readonly message: string;
|
|
31
|
+
}[]];
|
|
32
|
+
readonly compatibilityDate: "2026-05-21";
|
|
33
|
+
readonly groupId?: string | undefined;
|
|
34
|
+
}) => any) | undefined;
|
|
35
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
declare const _default: typeof __VLS_export;
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Value } from './schema.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
config: Value;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|