@shwfed/config 2.7.0 → 2.7.2

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 (75) hide show
  1. package/dist/mcp.mjs +1125 -1014
  2. package/dist/module.json +1 -1
  3. package/dist/preview/assets/badge-CJpxWUkB.js +1 -0
  4. package/dist/preview/assets/config-B-uvT_pb.js +1 -0
  5. package/dist/preview/assets/config-BRiILJ2a.js +1 -0
  6. package/dist/preview/assets/config-CbMKku2N.js +1 -0
  7. package/dist/preview/assets/config-D8tXo17l.js +1 -0
  8. package/dist/preview/assets/config-D9pA2oC8.js +1 -0
  9. package/dist/preview/assets/config-DtCRvYa9.js +1 -0
  10. package/dist/preview/assets/config-OQtpit00.js +1 -0
  11. package/dist/preview/assets/config-QHRydAV_.js +1 -0
  12. package/dist/preview/assets/config-dtgP-3mj.js +1 -0
  13. package/dist/preview/assets/definition.vue_vue_type_script_setup_true_lang-Dp8O3US_.js +1 -0
  14. package/dist/preview/assets/{index-BGFrUxgg.js → index-BBJQYeyQ.js} +170 -170
  15. package/dist/preview/assets/{index-Bw16PZhL.js → index-BWNTkzpm.js} +1 -1
  16. package/dist/preview/assets/index-ChitoGhE.js +1 -0
  17. package/dist/preview/assets/index-DFKLSxdT.css +1 -0
  18. package/dist/preview/assets/{item-aVe51Gy6.js → item-BpzTGOEt.js} +1 -1
  19. package/dist/preview/assets/{runtime-3rNI0KDH.js → runtime-B5S6icpw.js} +1 -1
  20. package/dist/preview/assets/{runtime-CYGmRjmI.js → runtime-BDyVuoP3.js} +1 -1
  21. package/dist/preview/assets/{runtime-CfVt6IWe.js → runtime-BjB2wvFX.js} +1 -1
  22. package/dist/preview/assets/{runtime-CXQuhSAX.js → runtime-Busbr90M.js} +1 -1
  23. package/dist/preview/assets/runtime-By0VH4uC.js +1 -0
  24. package/dist/preview/assets/{runtime-DYj-R8SZ.js → runtime-C29fORZL.js} +1 -1
  25. package/dist/preview/assets/runtime-DMsEFiBw.js +1 -0
  26. package/dist/preview/assets/runtime-DfP3qvGT.js +1 -0
  27. package/dist/preview/assets/runtime-DiTvLHpE.js +1 -0
  28. package/dist/preview/index.html +2 -2
  29. package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.xy/schema.d.ts +1 -1
  30. package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.xy/schema.js +1 -1
  31. package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/badge.d.vue.ts +7 -0
  32. package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/badge.vue +91 -0
  33. package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/badge.vue.d.ts +7 -0
  34. package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/config.d.vue.ts +96 -0
  35. package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/config.vue +522 -0
  36. package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/config.vue.d.ts +96 -0
  37. package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/runtime.d.vue.ts +96 -0
  38. package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/runtime.vue +72 -0
  39. package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/runtime.vue.d.ts +96 -0
  40. package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/schema.d.ts +121 -0
  41. package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/schema.js +100 -0
  42. package/dist/runtime/components/form/config.vue +10 -18
  43. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +2 -2
  44. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +2 -2
  45. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +2 -2
  46. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +2 -2
  47. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +2 -2
  48. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +2 -2
  49. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +2 -2
  50. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +2 -2
  51. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +2 -2
  52. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +2 -2
  53. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +2 -2
  54. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +2 -2
  55. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
  56. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
  57. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
  58. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
  59. package/package.json +1 -1
  60. package/dist/preview/assets/config-B5FFtD0s.js +0 -1
  61. package/dist/preview/assets/config-BpWP2vu_.js +0 -1
  62. package/dist/preview/assets/config-C2OqUTNd.js +0 -1
  63. package/dist/preview/assets/config-D7cjMBeK.js +0 -1
  64. package/dist/preview/assets/config-DhORWTZC.js +0 -1
  65. package/dist/preview/assets/config-DuuYvFG_.js +0 -1
  66. package/dist/preview/assets/config-dpwN2-UY.js +0 -1
  67. package/dist/preview/assets/config-eP0EblYK.js +0 -1
  68. package/dist/preview/assets/config-hs_pZ5MM.js +0 -1
  69. package/dist/preview/assets/definition.vue_vue_type_script_setup_true_lang-B8-Uydoy.js +0 -1
  70. package/dist/preview/assets/index-BoGW90Pq.css +0 -1
  71. package/dist/preview/assets/index-CG261V86.js +0 -1
  72. package/dist/preview/assets/runtime-BOn8EwHL.js +0 -1
  73. package/dist/preview/assets/runtime-Bwr-rb58.js +0 -1
  74. package/dist/preview/assets/runtime-Ca79Fs6I.js +0 -1
  75. package/dist/preview/assets/runtime-Dd1GqYeP.js +0 -1
@@ -0,0 +1,91 @@
1
+ <script setup>
2
+ import { computed, onMounted, ref, watch } from "vue";
3
+ import { Effect, Option } from "effect";
4
+ import { Fetch } from "fx-fetch";
5
+ import { useIntervalFn, useWindowFocus } from "@vueuse/core";
6
+ import { useI18n } from "vue-i18n";
7
+ import { getLocalizedText } from "../../../../../share/locale";
8
+ import { cel } from "../../../../../utils/cel";
9
+ import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
10
+ import { interpolateMarkdown } from "../../../../table/utils/runtime";
11
+ import { Badge } from "../../../../ui/badge";
12
+ import { Markdown } from "../../../../ui/markdown";
13
+ defineOptions({ name: "ShwfedBlockCardBadge", inheritAttrs: false });
14
+ const props = defineProps({
15
+ badge: { type: null, required: true }
16
+ });
17
+ const { locale } = useI18n();
18
+ const inheritedContext = injectCELContext();
19
+ const json = ref(void 0);
20
+ function baseContext() {
21
+ return celBindings(inheritedContext);
22
+ }
23
+ const jsonOption = computed(
24
+ () => json.value === void 0 ? Option.none() : Option.some(json.value)
25
+ );
26
+ const template = computed(() => getLocalizedText(props.badge.content, locale.value) || "");
27
+ const rendered = computed(() => {
28
+ if (!template.value) return "";
29
+ return interpolateMarkdown(template.value, cel, { ...baseContext(), json: jsonOption.value });
30
+ });
31
+ async function refresh() {
32
+ const req = props.badge.request;
33
+ if (!req) return;
34
+ const ctx = baseContext();
35
+ const program = Effect.gen(function* () {
36
+ const builder = yield* cel(req, ctx);
37
+ return yield* builder.json();
38
+ });
39
+ try {
40
+ json.value = await Effect.runPromise(Effect.provide(program, Fetch.layer));
41
+ } catch (e) {
42
+ console.warn("[shwfed-card-badge] fetch failed", e);
43
+ }
44
+ }
45
+ const pollingEnabled = computed(() => !!props.badge.request && (props.badge.interval ?? 0) > 0);
46
+ const intervalMs = computed(() => Math.max(1, props.badge.interval ?? 1) * 1e3);
47
+ const focused = useWindowFocus();
48
+ const { pause, resume } = useIntervalFn(() => void refresh(), intervalMs, { immediate: false });
49
+ onMounted(() => {
50
+ void refresh();
51
+ if (pollingEnabled.value && focused.value) resume();
52
+ });
53
+ watch(focused, (isFocused) => {
54
+ if (!pollingEnabled.value) return;
55
+ if (isFocused) {
56
+ void refresh();
57
+ resume();
58
+ } else {
59
+ pause();
60
+ }
61
+ });
62
+ watch(
63
+ () => [props.badge.request ?? "", props.badge.interval ?? 0].join("|"),
64
+ () => {
65
+ void refresh();
66
+ if (pollingEnabled.value && focused.value) resume();
67
+ else pause();
68
+ }
69
+ );
70
+ </script>
71
+
72
+ <template>
73
+ <template v-if="template">
74
+ <Badge
75
+ v-if="badge.dot"
76
+ :variant="badge.variant ?? 'default'"
77
+ class="size-2.5 min-w-0 rounded-full p-0"
78
+ v-bind="$attrs"
79
+ />
80
+ <Badge
81
+ v-else
82
+ :variant="badge.variant ?? 'default'"
83
+ v-bind="$attrs"
84
+ >
85
+ <Markdown
86
+ :source="rendered"
87
+ class="max-w-none text-inherit [&_*]:text-inherit [&_p]:m-0"
88
+ />
89
+ </Badge>
90
+ </template>
91
+ </template>
@@ -0,0 +1,7 @@
1
+ import type { BadgeValue } from './schema.js';
2
+ type __VLS_Props = {
3
+ badge: BadgeValue;
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;
@@ -0,0 +1,96 @@
1
+ import type { Environment } from '../../../../../vendor/cel-js/lib/index.js';
2
+ import { type Value } from './schema.js';
3
+ type __VLS_Props = {
4
+ configure?: (env: Environment) => void;
5
+ };
6
+ type __VLS_ModelProps = {
7
+ modelValue: Value;
8
+ };
9
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
10
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
+ "update:modelValue": (value: {
12
+ readonly type: "com.shwfed.block.card";
13
+ readonly style?: string | undefined;
14
+ readonly id: string;
15
+ readonly slot: {
16
+ readonly blocks: readonly any[];
17
+ readonly layouts: readonly {
18
+ readonly name: string;
19
+ readonly layout: {
20
+ readonly style?: string | undefined;
21
+ readonly columns: number;
22
+ readonly gap?: number | undefined;
23
+ readonly rows?: number | undefined;
24
+ readonly placements: {
25
+ readonly [x: string]: {
26
+ readonly area: readonly [readonly [number, number], readonly [number, number]];
27
+ readonly v?: "stretch" | "center" | "end" | "start" | undefined;
28
+ readonly h?: "stretch" | "center" | "end" | "start" | undefined;
29
+ };
30
+ };
31
+ };
32
+ readonly media?: string | undefined;
33
+ }[];
34
+ };
35
+ readonly displayName?: string | undefined;
36
+ readonly url?: string | undefined;
37
+ readonly compatibilityDate: "2026-06-02";
38
+ readonly badge?: {
39
+ readonly content?: readonly [{
40
+ readonly locale: "zh";
41
+ readonly message: string;
42
+ }, ...{
43
+ readonly locale: "en" | "ja" | "ko";
44
+ readonly message: string;
45
+ }[]] | undefined;
46
+ readonly dot?: boolean | undefined;
47
+ readonly variant?: "default" | "destructive" | "outline" | "secondary" | undefined;
48
+ readonly request?: string | undefined;
49
+ readonly interval?: number | undefined;
50
+ } | undefined;
51
+ }) => any;
52
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
53
+ "onUpdate:modelValue"?: ((value: {
54
+ readonly type: "com.shwfed.block.card";
55
+ readonly style?: string | undefined;
56
+ readonly id: string;
57
+ readonly slot: {
58
+ readonly blocks: readonly any[];
59
+ readonly layouts: readonly {
60
+ readonly name: string;
61
+ readonly layout: {
62
+ readonly style?: string | undefined;
63
+ readonly columns: number;
64
+ readonly gap?: number | undefined;
65
+ readonly rows?: number | undefined;
66
+ readonly placements: {
67
+ readonly [x: string]: {
68
+ readonly area: readonly [readonly [number, number], readonly [number, number]];
69
+ readonly v?: "stretch" | "center" | "end" | "start" | undefined;
70
+ readonly h?: "stretch" | "center" | "end" | "start" | undefined;
71
+ };
72
+ };
73
+ };
74
+ readonly media?: string | undefined;
75
+ }[];
76
+ };
77
+ readonly displayName?: string | undefined;
78
+ readonly url?: string | undefined;
79
+ readonly compatibilityDate: "2026-06-02";
80
+ readonly badge?: {
81
+ readonly content?: readonly [{
82
+ readonly locale: "zh";
83
+ readonly message: string;
84
+ }, ...{
85
+ readonly locale: "en" | "ja" | "ko";
86
+ readonly message: string;
87
+ }[]] | undefined;
88
+ readonly dot?: boolean | undefined;
89
+ readonly variant?: "default" | "destructive" | "outline" | "secondary" | undefined;
90
+ readonly request?: string | undefined;
91
+ readonly interval?: number | undefined;
92
+ } | undefined;
93
+ }) => any) | undefined;
94
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
95
+ declare const _default: typeof __VLS_export;
96
+ export default _default;