@shwfed/config 2.3.4 → 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.
Files changed (37) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/actions/components/group.d.vue.ts +12 -12
  3. package/dist/runtime/components/actions/components/group.vue +46 -12
  4. package/dist/runtime/components/actions/components/group.vue.d.ts +12 -12
  5. package/dist/runtime/components/actions/config.d.vue.ts +13 -13
  6. package/dist/runtime/components/actions/config.vue +206 -16
  7. package/dist/runtime/components/actions/config.vue.d.ts +13 -13
  8. package/dist/runtime/components/actions/items/2026-05-21/com.shwfed.actions.item.markdown/config.d.vue.ts +37 -0
  9. package/dist/runtime/components/actions/items/2026-05-21/com.shwfed.actions.item.markdown/config.vue +61 -0
  10. package/dist/runtime/components/actions/items/2026-05-21/com.shwfed.actions.item.markdown/config.vue.d.ts +37 -0
  11. package/dist/runtime/components/actions/items/2026-05-21/com.shwfed.actions.item.markdown/runtime.d.vue.ts +7 -0
  12. package/dist/runtime/components/actions/items/2026-05-21/com.shwfed.actions.item.markdown/runtime.vue +22 -0
  13. package/dist/runtime/components/actions/items/2026-05-21/com.shwfed.actions.item.markdown/runtime.vue.d.ts +7 -0
  14. package/dist/runtime/components/actions/items/2026-05-21/com.shwfed.actions.item.markdown/schema.d.ts +23 -0
  15. package/dist/runtime/components/actions/items/2026-05-21/com.shwfed.actions.item.markdown/schema.js +29 -0
  16. package/dist/runtime/components/actions/schema.d.ts +399 -196
  17. package/dist/runtime/components/actions/schema.js +13 -4
  18. package/dist/runtime/components/actions/utils/resolve.d.ts +15 -0
  19. package/dist/runtime/components/actions/utils/resolve.js +45 -0
  20. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.actions/config.d.vue.ts +10 -10
  21. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.actions/config.vue.d.ts +10 -10
  22. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.actions/runtime.d.vue.ts +10 -10
  23. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.actions/runtime.vue.d.ts +10 -10
  24. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.actions/schema.d.ts +115 -58
  25. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +10 -10
  26. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +10 -10
  27. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +10 -10
  28. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +10 -10
  29. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +120 -63
  30. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/config.d.vue.ts +10 -10
  31. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/config.vue.d.ts +10 -10
  32. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/schema.d.ts +115 -58
  33. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.actions/schema.d.ts +115 -58
  34. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
  35. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
  36. package/dist/runtime/components/table/schema.d.ts +125 -68
  37. package/package.json +1 -1
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "shwfed",
3
3
  "configKey": "shwfed",
4
- "version": "2.3.4",
4
+ "version": "2.3.5",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -9,9 +9,9 @@ type __VLS_ModelProps = {
9
9
  'config': ActionConfigType;
10
10
  };
11
11
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
12
- declare var __VLS_171: {};
12
+ declare var __VLS_181: {};
13
13
  type __VLS_Slots = {} & {
14
- default?: (props: typeof __VLS_171) => any;
14
+ default?: (props: typeof __VLS_181) => any;
15
15
  };
16
16
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
17
  "update:config": (value: {
@@ -19,7 +19,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
19
19
  readonly style?: string | undefined;
20
20
  readonly gap: number;
21
21
  readonly kind: "shwfed.component.action";
22
- readonly items: readonly ({
22
+ readonly items: readonly (import("../schema.js").RegistryItemValue | {
23
23
  readonly disabled?: string | undefined;
24
24
  readonly id: string;
25
25
  readonly title: readonly [{
@@ -52,9 +52,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
52
52
  readonly message: string;
53
53
  }[]];
54
54
  readonly icon?: string | undefined;
55
- readonly groupId: string;
56
- readonly hideTitle?: boolean | undefined;
57
- readonly items: readonly {
55
+ readonly items: readonly (import("../schema.js").RegistrySubItemValue | {
58
56
  readonly disabled?: string | undefined;
59
57
  readonly id: string;
60
58
  readonly title: readonly [{
@@ -75,7 +73,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
75
73
  }[]] | undefined;
76
74
  readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
77
75
  readonly action?: any;
78
- }[];
76
+ })[];
77
+ readonly groupId: string;
78
+ readonly hideTitle?: boolean | undefined;
79
79
  })[];
80
80
  readonly groups: readonly {
81
81
  readonly id: string;
@@ -88,7 +88,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
88
88
  readonly style?: string | undefined;
89
89
  readonly gap: number;
90
90
  readonly kind: "shwfed.component.action";
91
- readonly items: readonly ({
91
+ readonly items: readonly (import("../schema.js").RegistryItemValue | {
92
92
  readonly disabled?: string | undefined;
93
93
  readonly id: string;
94
94
  readonly title: readonly [{
@@ -121,9 +121,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
121
121
  readonly message: string;
122
122
  }[]];
123
123
  readonly icon?: string | undefined;
124
- readonly groupId: string;
125
- readonly hideTitle?: boolean | undefined;
126
- readonly items: readonly {
124
+ readonly items: readonly (import("../schema.js").RegistrySubItemValue | {
127
125
  readonly disabled?: string | undefined;
128
126
  readonly id: string;
129
127
  readonly title: readonly [{
@@ -144,7 +142,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
144
142
  }[]] | undefined;
145
143
  readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
146
144
  readonly action?: any;
147
- }[];
145
+ })[];
146
+ readonly groupId: string;
147
+ readonly hideTitle?: boolean | undefined;
148
148
  })[];
149
149
  readonly groups: readonly {
150
150
  readonly id: string;
@@ -14,7 +14,7 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "../../ui/tooltip";
14
14
  import { cel as _rawCel } from "../../../utils/cel";
15
15
  import { celBindings, injectCELContext } from "../../../utils/cel-context";
16
16
  import { buttonRegistryKey } from "../utils/button-registry";
17
- import { findButton } from "../utils/resolve";
17
+ import { findButton, findItem } from "../utils/resolve";
18
18
  import { Fetch } from "fx-fetch";
19
19
  import { toast } from "vue-sonner";
20
20
  defineOptions({
@@ -82,8 +82,10 @@ const declaredActions = reactive({});
82
82
  const actionRuntimes = computed(() => {
83
83
  const list = [];
84
84
  for (const item of config.value.items) {
85
+ if (isRegistryItem(item)) continue;
85
86
  if (isDropdownItem(item)) {
86
87
  for (const child of item.items) {
88
+ if (isRegistrySubItem(child)) continue;
87
89
  if (!child.action) continue;
88
90
  const entry2 = findButton(child.action.type, child.action.compatibilityDate);
89
91
  if (!entry2) {
@@ -115,8 +117,9 @@ const actionRuntimes = computed(() => {
115
117
  return list;
116
118
  });
117
119
  const actionIds = computed(() => config.value.items.flatMap((item) => {
120
+ if (isRegistryItem(item)) return [];
118
121
  if (isDropdownItem(item)) {
119
- return item.items.map((child) => child.id);
122
+ return item.items.filter((child) => !isRegistrySubItem(child)).map((child) => child.id);
120
123
  }
121
124
  return [item.id];
122
125
  }));
@@ -177,8 +180,10 @@ watch(actionIdSet, () => {
177
180
  const modalDefinitions = computed(() => {
178
181
  const nextDefinitions = [];
179
182
  for (const item of config.value.items) {
183
+ if (isRegistryItem(item)) continue;
180
184
  if (isDropdownItem(item)) {
181
185
  for (const child of item.items) {
186
+ if (isRegistrySubItem(child)) continue;
182
187
  const declaration2 = declaredActions[child.id];
183
188
  if (!declaration2?.render) continue;
184
189
  nextDefinitions.push({
@@ -260,14 +265,30 @@ function isButtonDisabled(button) {
260
265
  return evaluateExpression(button.disabled, false) || isPending(button.id) || !(isEffectValue(effect) || isEffectFactory(effect));
261
266
  }
262
267
  function isDropdownPending(dropdown) {
263
- return dropdown.items.some((item) => !isButtonHidden(item) && isPending(item.id));
268
+ return dropdown.items.some(
269
+ (item) => !isRegistrySubItem(item) && !isButtonHidden(item) && isPending(item.id)
270
+ );
264
271
  }
265
272
  function hasVisibleDropdownItems(dropdown) {
266
- return dropdown.items.some((item) => !isButtonHidden(item));
273
+ return dropdown.items.some(
274
+ (item) => isRegistrySubItem(item) || !isButtonHidden(item)
275
+ );
267
276
  }
268
277
  function isDropdownItem(item) {
269
278
  return "items" in item;
270
279
  }
280
+ function isRegistryItem(item) {
281
+ return "type" in item && "compatibilityDate" in item;
282
+ }
283
+ function isRegistrySubItem(item) {
284
+ return "type" in item && "compatibilityDate" in item;
285
+ }
286
+ function getItemRuntime(item) {
287
+ return findItem(item.type, item.compatibilityDate)?.runtime;
288
+ }
289
+ function isButtonDropdownChild(item) {
290
+ return !isRegistrySubItem(item);
291
+ }
271
292
  function getResolvedButtonVariant(group, button) {
272
293
  return button.variant ?? group.variant ?? "default";
273
294
  }
@@ -283,9 +304,9 @@ function hasLeadingPrimaryGap(group, itemIndex) {
283
304
  }
284
305
  const item = group.items[itemIndex];
285
306
  const previousItem = group.items[itemIndex - 1];
286
- if (!item || !previousItem || isDropdownItem(item) || isDropdownItem(previousItem)) {
287
- return false;
288
- }
307
+ if (!item || !previousItem) return false;
308
+ if (isDropdownItem(item) || isDropdownItem(previousItem)) return false;
309
+ if (isRegistryItem(item) || isRegistryItem(previousItem)) return false;
289
310
  return getResolvedButtonVariant(group, item) === "primary" && getResolvedButtonVariant(group, previousItem) === "primary";
290
311
  }
291
312
  function handleBadResponse(error) {
@@ -346,7 +367,7 @@ async function runButton(buttonId) {
346
367
  <ClientOnly>
347
368
  <div
348
369
  data-slot="buttons"
349
- :class="cn('relative flex flex-wrap items-start')"
370
+ :class="cn('relative flex flex-wrap items-baseline')"
350
371
  :style="[
351
372
  rootStyle,
352
373
  config.style
@@ -374,8 +395,14 @@ async function runButton(buttonId) {
374
395
  v-for="(item, itemIndex) in group.items"
375
396
  :key="item.id"
376
397
  >
398
+ <component
399
+ :is="getItemRuntime(item)"
400
+ v-if="isRegistryItem(item) && getItemRuntime(item)"
401
+ :config="item"
402
+ />
403
+
377
404
  <Button
378
- v-if="!isDropdownItem(item) && !isButtonHidden(item) && !hasButtonTooltip(item)"
405
+ v-else-if="!isRegistryItem(item) && !isDropdownItem(item) && !isButtonHidden(item) && !hasButtonTooltip(item)"
379
406
  data-slot="buttons-item"
380
407
  :variant="getResolvedButtonVariant(group, item)"
381
408
  :size="getResolvedSize()"
@@ -395,7 +422,7 @@ async function runButton(buttonId) {
395
422
  </Button>
396
423
 
397
424
  <Tooltip
398
- v-else-if="!isDropdownItem(item) && !isButtonHidden(item)"
425
+ v-else-if="!isRegistryItem(item) && !isDropdownItem(item) && !isButtonHidden(item)"
399
426
  :delay-duration="180"
400
427
  >
401
428
  <TooltipTrigger as-child>
@@ -457,8 +484,15 @@ async function runButton(buttonId) {
457
484
  v-for="child in item.items"
458
485
  :key="child.id"
459
486
  >
487
+ <component
488
+ :is="getItemRuntime(child)"
489
+ v-if="isRegistrySubItem(child) && getItemRuntime(child)"
490
+ data-slot="buttons-dropdown-item-registry"
491
+ :config="child"
492
+ />
493
+
460
494
  <DropdownMenuItem
461
- v-if="!isButtonHidden(child) && !hasButtonTooltip(child)"
495
+ v-else-if="isButtonDropdownChild(child) && !isButtonHidden(child) && !hasButtonTooltip(child)"
462
496
  data-slot="buttons-dropdown-item"
463
497
  :disabled="isButtonDisabled(child)"
464
498
  @select="void runButton(child.id)"
@@ -475,7 +509,7 @@ async function runButton(buttonId) {
475
509
  </DropdownMenuItem>
476
510
 
477
511
  <Tooltip
478
- v-else-if="!isButtonHidden(child)"
512
+ v-else-if="isButtonDropdownChild(child) && !isButtonHidden(child)"
479
513
  :delay-duration="180"
480
514
  >
481
515
  <TooltipTrigger as-child>
@@ -9,9 +9,9 @@ type __VLS_ModelProps = {
9
9
  'config': ActionConfigType;
10
10
  };
11
11
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
12
- declare var __VLS_171: {};
12
+ declare var __VLS_181: {};
13
13
  type __VLS_Slots = {} & {
14
- default?: (props: typeof __VLS_171) => any;
14
+ default?: (props: typeof __VLS_181) => any;
15
15
  };
16
16
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
17
  "update:config": (value: {
@@ -19,7 +19,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
19
19
  readonly style?: string | undefined;
20
20
  readonly gap: number;
21
21
  readonly kind: "shwfed.component.action";
22
- readonly items: readonly ({
22
+ readonly items: readonly (import("../schema.js").RegistryItemValue | {
23
23
  readonly disabled?: string | undefined;
24
24
  readonly id: string;
25
25
  readonly title: readonly [{
@@ -52,9 +52,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
52
52
  readonly message: string;
53
53
  }[]];
54
54
  readonly icon?: string | undefined;
55
- readonly groupId: string;
56
- readonly hideTitle?: boolean | undefined;
57
- readonly items: readonly {
55
+ readonly items: readonly (import("../schema.js").RegistrySubItemValue | {
58
56
  readonly disabled?: string | undefined;
59
57
  readonly id: string;
60
58
  readonly title: readonly [{
@@ -75,7 +73,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
75
73
  }[]] | undefined;
76
74
  readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
77
75
  readonly action?: any;
78
- }[];
76
+ })[];
77
+ readonly groupId: string;
78
+ readonly hideTitle?: boolean | undefined;
79
79
  })[];
80
80
  readonly groups: readonly {
81
81
  readonly id: string;
@@ -88,7 +88,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
88
88
  readonly style?: string | undefined;
89
89
  readonly gap: number;
90
90
  readonly kind: "shwfed.component.action";
91
- readonly items: readonly ({
91
+ readonly items: readonly (import("../schema.js").RegistryItemValue | {
92
92
  readonly disabled?: string | undefined;
93
93
  readonly id: string;
94
94
  readonly title: readonly [{
@@ -121,9 +121,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
121
121
  readonly message: string;
122
122
  }[]];
123
123
  readonly icon?: string | undefined;
124
- readonly groupId: string;
125
- readonly hideTitle?: boolean | undefined;
126
- readonly items: readonly {
124
+ readonly items: readonly (import("../schema.js").RegistrySubItemValue | {
127
125
  readonly disabled?: string | undefined;
128
126
  readonly id: string;
129
127
  readonly title: readonly [{
@@ -144,7 +142,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
144
142
  }[]] | undefined;
145
143
  readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
146
144
  readonly action?: any;
147
- }[];
145
+ })[];
146
+ readonly groupId: string;
147
+ readonly hideTitle?: boolean | undefined;
148
148
  })[];
149
149
  readonly groups: readonly {
150
150
  readonly id: string;
@@ -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 __VLS_183: {};
10
+ declare var __VLS_196: {};
11
11
  type __VLS_Slots = {} & {
12
- 'general-extra'?: (props: typeof __VLS_183) => any;
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,9 +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 groupId: string;
54
- readonly hideTitle?: boolean | undefined;
55
- readonly items: readonly {
53
+ readonly items: readonly (RegistrySubItemValue | {
56
54
  readonly disabled?: string | undefined;
57
55
  readonly id: string;
58
56
  readonly title: readonly [{
@@ -73,7 +71,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
73
71
  }[]] | undefined;
74
72
  readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
75
73
  readonly action?: any;
76
- }[];
74
+ })[];
75
+ readonly groupId: string;
76
+ readonly hideTitle?: boolean | undefined;
77
77
  })[];
78
78
  readonly groups: readonly {
79
79
  readonly id: string;
@@ -86,7 +86,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
86
86
  readonly style?: string | undefined;
87
87
  readonly gap: number;
88
88
  readonly kind: "shwfed.component.action";
89
- readonly items: readonly ({
89
+ readonly items: readonly (RegistryItemValue | {
90
90
  readonly disabled?: string | undefined;
91
91
  readonly id: string;
92
92
  readonly title: readonly [{
@@ -119,9 +119,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
119
119
  readonly message: string;
120
120
  }[]];
121
121
  readonly icon?: string | undefined;
122
- readonly groupId: string;
123
- readonly hideTitle?: boolean | undefined;
124
- readonly items: readonly {
122
+ readonly items: readonly (RegistrySubItemValue | {
125
123
  readonly disabled?: string | undefined;
126
124
  readonly id: string;
127
125
  readonly title: readonly [{
@@ -142,7 +140,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
142
140
  }[]] | undefined;
143
141
  readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
144
142
  readonly action?: any;
145
- }[];
143
+ })[];
144
+ readonly groupId: string;
145
+ readonly hideTitle?: boolean | undefined;
146
146
  })[];
147
147
  readonly groups: readonly {
148
148
  readonly id: string;