@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.
Files changed (44) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/actions/components/group.d.vue.ts +12 -10
  3. package/dist/runtime/components/actions/components/group.vue +47 -13
  4. package/dist/runtime/components/actions/components/group.vue.d.ts +12 -10
  5. package/dist/runtime/components/actions/config.d.vue.ts +13 -11
  6. package/dist/runtime/components/actions/config.vue +252 -35
  7. package/dist/runtime/components/actions/config.vue.d.ts +13 -11
  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 +400 -193
  17. package/dist/runtime/components/actions/schema.js +22 -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 -8
  21. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.actions/config.vue.d.ts +10 -8
  22. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.actions/runtime.d.vue.ts +10 -8
  23. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.actions/runtime.vue.d.ts +10 -8
  24. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.actions/schema.d.ts +115 -57
  25. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +10 -8
  26. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +10 -8
  27. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +10 -8
  28. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +10 -8
  29. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +120 -61
  30. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/config.d.vue.ts +10 -8
  31. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/config.vue.d.ts +10 -8
  32. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/schema.d.ts +115 -57
  33. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.actions/schema.d.ts +115 -57
  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/columns/2026-05-20/com.shwfed.table.column.combobox-single/runtime.vue +4 -4
  37. package/dist/runtime/components/table/schema.d.ts +125 -65
  38. package/dist/runtime/components/table/utils/row-reorder.js +16 -5
  39. package/dist/runtime/vendor/cel-js/CLAUDE.md +5 -1
  40. package/dist/runtime/vendor/cel-js/PROMPT.md +19 -0
  41. package/dist/runtime/vendor/cel-js/lib/evaluator.js +2 -0
  42. package/dist/runtime/vendor/cel-js/lib/form-builtins.d.ts +2 -0
  43. package/dist/runtime/vendor/cel-js/lib/form-builtins.js +58 -0
  44. 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.3",
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,8 +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 items: readonly {
55
+ readonly items: readonly (import("../schema.js").RegistrySubItemValue | {
57
56
  readonly disabled?: string | undefined;
58
57
  readonly id: string;
59
58
  readonly title: readonly [{
@@ -74,7 +73,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
74
73
  }[]] | undefined;
75
74
  readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
76
75
  readonly action?: any;
77
- }[];
76
+ })[];
77
+ readonly groupId: string;
78
+ readonly hideTitle?: boolean | undefined;
78
79
  })[];
79
80
  readonly groups: readonly {
80
81
  readonly id: string;
@@ -87,7 +88,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
87
88
  readonly style?: string | undefined;
88
89
  readonly gap: number;
89
90
  readonly kind: "shwfed.component.action";
90
- readonly items: readonly ({
91
+ readonly items: readonly (import("../schema.js").RegistryItemValue | {
91
92
  readonly disabled?: string | undefined;
92
93
  readonly id: string;
93
94
  readonly title: readonly [{
@@ -120,8 +121,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
120
121
  readonly message: string;
121
122
  }[]];
122
123
  readonly icon?: string | undefined;
123
- readonly groupId: string;
124
- readonly items: readonly {
124
+ readonly items: readonly (import("../schema.js").RegistrySubItemValue | {
125
125
  readonly disabled?: string | undefined;
126
126
  readonly id: string;
127
127
  readonly title: readonly [{
@@ -142,7 +142,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
142
142
  }[]] | undefined;
143
143
  readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
144
144
  readonly action?: any;
145
- }[];
145
+ })[];
146
+ readonly groupId: string;
147
+ readonly hideTitle?: boolean | undefined;
146
148
  })[];
147
149
  readonly groups: readonly {
148
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>
@@ -448,7 +475,7 @@ async function runButton(buttonId) {
448
475
  v-else-if="item.icon"
449
476
  :icon="item.icon"
450
477
  />
451
- <span>{{ getDropdownLabel(item) }}</span>
478
+ <span v-if="!item.hideTitle">{{ getDropdownLabel(item) }}</span>
452
479
  </Button>
453
480
  </DropdownMenuTrigger>
454
481
 
@@ -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,8 +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 items: readonly {
55
+ readonly items: readonly (import("../schema.js").RegistrySubItemValue | {
57
56
  readonly disabled?: string | undefined;
58
57
  readonly id: string;
59
58
  readonly title: readonly [{
@@ -74,7 +73,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
74
73
  }[]] | undefined;
75
74
  readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
76
75
  readonly action?: any;
77
- }[];
76
+ })[];
77
+ readonly groupId: string;
78
+ readonly hideTitle?: boolean | undefined;
78
79
  })[];
79
80
  readonly groups: readonly {
80
81
  readonly id: string;
@@ -87,7 +88,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
87
88
  readonly style?: string | undefined;
88
89
  readonly gap: number;
89
90
  readonly kind: "shwfed.component.action";
90
- readonly items: readonly ({
91
+ readonly items: readonly (import("../schema.js").RegistryItemValue | {
91
92
  readonly disabled?: string | undefined;
92
93
  readonly id: string;
93
94
  readonly title: readonly [{
@@ -120,8 +121,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
120
121
  readonly message: string;
121
122
  }[]];
122
123
  readonly icon?: string | undefined;
123
- readonly groupId: string;
124
- readonly items: readonly {
124
+ readonly items: readonly (import("../schema.js").RegistrySubItemValue | {
125
125
  readonly disabled?: string | undefined;
126
126
  readonly id: string;
127
127
  readonly title: readonly [{
@@ -142,7 +142,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
142
142
  }[]] | undefined;
143
143
  readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
144
144
  readonly action?: any;
145
- }[];
145
+ })[];
146
+ readonly groupId: string;
147
+ readonly hideTitle?: boolean | undefined;
146
148
  })[];
147
149
  readonly groups: readonly {
148
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,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 groupId: string;
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 groupId: string;
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;