@shwfed/nuxt 0.10.14 → 0.11.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.
Files changed (80) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +1 -0
  3. package/dist/runtime/components/app.d.vue.ts +2 -1
  4. package/dist/runtime/components/app.vue.d.ts +2 -1
  5. package/dist/runtime/components/button.d.vue.ts +67 -4
  6. package/dist/runtime/components/button.vue +29 -4
  7. package/dist/runtime/components/button.vue.d.ts +67 -4
  8. package/dist/runtime/components/component-config.d.ts +12 -0
  9. package/dist/runtime/components/component-config.js +22 -0
  10. package/dist/runtime/components/fields.d.vue.ts +9 -5
  11. package/dist/runtime/components/fields.vue +14 -5
  12. package/dist/runtime/components/fields.vue.d.ts +9 -5
  13. package/dist/runtime/components/markdown.d.vue.ts +19 -9
  14. package/dist/runtime/components/markdown.vue +15 -3
  15. package/dist/runtime/components/markdown.vue.d.ts +19 -9
  16. package/dist/runtime/components/menu-tabs.d.vue.ts +14 -4
  17. package/dist/runtime/components/menu-tabs.vue +15 -3
  18. package/dist/runtime/components/menu-tabs.vue.d.ts +14 -4
  19. package/dist/runtime/components/modal.d.vue.ts +3 -1
  20. package/dist/runtime/components/modal.vue +3 -1
  21. package/dist/runtime/components/modal.vue.d.ts +3 -1
  22. package/dist/runtime/components/table.d.vue.ts +8 -3
  23. package/dist/runtime/components/table.vue +28 -2
  24. package/dist/runtime/components/table.vue.d.ts +8 -3
  25. package/dist/runtime/components/ui/app/App.d.vue.ts +7 -5
  26. package/dist/runtime/components/ui/app/App.vue +23 -8
  27. package/dist/runtime/components/ui/app/App.vue.d.ts +7 -5
  28. package/dist/runtime/components/ui/app/OverlayHost.d.vue.ts +3 -0
  29. package/dist/runtime/components/ui/app/OverlayHost.vue +91 -0
  30. package/dist/runtime/components/ui/app/OverlayHost.vue.d.ts +3 -0
  31. package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.d.vue.ts +56 -0
  32. package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.vue +12 -4
  33. package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.vue.d.ts +56 -0
  34. package/dist/runtime/components/ui/buttons/Buttons.d.vue.ts +62 -5
  35. package/dist/runtime/components/ui/buttons/Buttons.vue +71 -7
  36. package/dist/runtime/components/ui/buttons/Buttons.vue.d.ts +62 -5
  37. package/dist/runtime/components/ui/buttons/schema.d.ts +562 -2
  38. package/dist/runtime/components/ui/buttons/schema.js +24 -23
  39. package/dist/runtime/components/ui/drawer/Drawer.d.vue.ts +4 -4
  40. package/dist/runtime/components/ui/drawer/Drawer.vue.d.ts +4 -4
  41. package/dist/runtime/components/ui/fields/Fields.d.vue.ts +10 -2
  42. package/dist/runtime/components/ui/fields/Fields.vue +12 -3
  43. package/dist/runtime/components/ui/fields/Fields.vue.d.ts +10 -2
  44. package/dist/runtime/components/ui/fields/schema.d.ts +464 -0
  45. package/dist/runtime/components/ui/fields/schema.js +15 -2
  46. package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.d.vue.ts +4 -0
  47. package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue +10 -4
  48. package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue.d.ts +4 -0
  49. package/dist/runtime/components/ui/markdown/Markdown.d.vue.ts +18 -8
  50. package/dist/runtime/components/ui/markdown/Markdown.vue +13 -3
  51. package/dist/runtime/components/ui/markdown/Markdown.vue.d.ts +18 -8
  52. package/dist/runtime/components/ui/markdown/schema.d.ts +51 -6
  53. package/dist/runtime/components/ui/markdown/schema.js +15 -2
  54. package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.d.vue.ts +16 -7
  55. package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.vue +12 -7
  56. package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.vue.d.ts +16 -7
  57. package/dist/runtime/components/ui/menu-tabs/MenuTabs.d.vue.ts +14 -4
  58. package/dist/runtime/components/ui/menu-tabs/MenuTabs.vue +16 -5
  59. package/dist/runtime/components/ui/menu-tabs/MenuTabs.vue.d.ts +14 -4
  60. package/dist/runtime/components/ui/menu-tabs/schema.d.ts +42 -5
  61. package/dist/runtime/components/ui/menu-tabs/schema.js +13 -12
  62. package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.d.vue.ts +12 -3
  63. package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.vue +9 -5
  64. package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.vue.d.ts +12 -3
  65. package/dist/runtime/components/ui/table/Table.d.vue.ts +6 -2
  66. package/dist/runtime/components/ui/table/Table.vue +18 -2
  67. package/dist/runtime/components/ui/table/Table.vue.d.ts +6 -2
  68. package/dist/runtime/components/ui/table/schema.d.ts +239 -2
  69. package/dist/runtime/components/ui/table/schema.js +15 -6
  70. package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.d.vue.ts +4 -0
  71. package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.vue +2 -1
  72. package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.vue.d.ts +4 -0
  73. package/dist/runtime/composables/useOverlay.d.ts +86 -0
  74. package/dist/runtime/composables/useOverlay.js +201 -0
  75. package/dist/runtime/layouts/default.d.vue.ts +2 -1
  76. package/dist/runtime/layouts/default.vue.d.ts +2 -1
  77. package/dist/runtime/plugins/overlay/index.d.ts +6 -0
  78. package/dist/runtime/plugins/overlay/index.js +12 -0
  79. package/dist/runtime/plugins/toast/index.d.ts +4 -4
  80. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { Effect } from 'effect';
2
2
  import type { MenuTabsConfigInput } from './ui/menu-tabs/schema.js';
3
- export { MenuTabsConfigC, MenuTabsConfigInputC, MenuTabsItemC, MenuTabsItemToC } from './ui/menu-tabs/schema.js';
4
- export type { MenuTabsConfig, MenuTabsConfigInput, MenuTabsItem } from './ui/menu-tabs/schema.js';
3
+ export { CURRENT_COMPATIBILITY_DATE, KIND, MenuTabsBodyC, MenuTabsBodyInputC, MenuTabsConfigC, MenuTabsConfigInputC, MenuTabsItemC, MenuTabsItemToC, SUPPORTED_COMPATIBILITY_DATES, createMenuTabsConfig, } from './ui/menu-tabs/schema.js';
4
+ export type { MenuTabsBody, MenuTabsBodyInput, MenuTabsConfig, MenuTabsConfigInput, MenuTabsItem, } from './ui/menu-tabs/schema.js';
5
5
  declare const _default: typeof __VLS_export;
6
6
  export default _default;
7
7
  declare const __VLS_export: import("vue").DefineComponent<{
@@ -11,9 +11,14 @@ declare const __VLS_export: import("vue").DefineComponent<{
11
11
  "update:config": (args_0: Readonly<{
12
12
  menus: readonly Readonly<{
13
13
  id: string;
14
- title: import("../utils/coders.js").LocaleValue;
14
+ title: readonly {
15
+ locale: "zh" | "ja" | "en" | "ko";
16
+ message: string;
17
+ }[];
15
18
  to: string;
16
19
  }>[];
20
+ kind: string;
21
+ compatibilityDate: string;
17
22
  }>) => any;
18
23
  }, string, import("vue").PublicProps, Readonly<{
19
24
  config?: MenuTabsConfigInput | Effect.Effect<MenuTabsConfigInput | undefined>;
@@ -22,8 +27,13 @@ declare const __VLS_export: import("vue").DefineComponent<{
22
27
  "onUpdate:config"?: ((args_0: Readonly<{
23
28
  menus: readonly Readonly<{
24
29
  id: string;
25
- title: import("../utils/coders.js").LocaleValue;
30
+ title: readonly {
31
+ locale: "zh" | "ja" | "en" | "ko";
32
+ message: string;
33
+ }[];
26
34
  to: string;
27
35
  }>[];
36
+ kind: string;
37
+ compatibilityDate: string;
28
38
  }>) => any) | undefined;
29
39
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1,5 +1,6 @@
1
1
  <script setup>
2
2
  import { Effect } from "effect";
3
+ import { createMenuTabsConfig } from "./ui/menu-tabs/schema";
3
4
  import UiMenuTabs from "./ui/menu-tabs/MenuTabs.vue";
4
5
  defineOptions({
5
6
  inheritAttrs: false
@@ -9,9 +10,9 @@ const props = defineProps({
9
10
  context: { type: Object, required: false }
10
11
  });
11
12
  const emit = defineEmits(["update:config"]);
12
- const defaultConfig = {
13
+ const defaultConfig = createMenuTabsConfig({
13
14
  menus: []
14
- };
15
+ });
15
16
  function isEffectConfig(value) {
16
17
  return typeof value === "object" && value !== null && "pipe" in value && typeof Reflect.get(value, "pipe") === "function";
17
18
  }
@@ -27,7 +28,18 @@ function handleConfigUpdate(config) {
27
28
  </script>
28
29
 
29
30
  <script>
30
- export { MenuTabsConfigC, MenuTabsConfigInputC, MenuTabsItemC, MenuTabsItemToC } from "./ui/menu-tabs/schema";
31
+ export {
32
+ CURRENT_COMPATIBILITY_DATE,
33
+ KIND,
34
+ MenuTabsBodyC,
35
+ MenuTabsBodyInputC,
36
+ MenuTabsConfigC,
37
+ MenuTabsConfigInputC,
38
+ MenuTabsItemC,
39
+ MenuTabsItemToC,
40
+ SUPPORTED_COMPATIBILITY_DATES,
41
+ createMenuTabsConfig
42
+ } from "./ui/menu-tabs/schema";
31
43
  </script>
32
44
 
33
45
  <template>
@@ -1,7 +1,7 @@
1
1
  import { Effect } from 'effect';
2
2
  import type { MenuTabsConfigInput } from './ui/menu-tabs/schema.js';
3
- export { MenuTabsConfigC, MenuTabsConfigInputC, MenuTabsItemC, MenuTabsItemToC } from './ui/menu-tabs/schema.js';
4
- export type { MenuTabsConfig, MenuTabsConfigInput, MenuTabsItem } from './ui/menu-tabs/schema.js';
3
+ export { CURRENT_COMPATIBILITY_DATE, KIND, MenuTabsBodyC, MenuTabsBodyInputC, MenuTabsConfigC, MenuTabsConfigInputC, MenuTabsItemC, MenuTabsItemToC, SUPPORTED_COMPATIBILITY_DATES, createMenuTabsConfig, } from './ui/menu-tabs/schema.js';
4
+ export type { MenuTabsBody, MenuTabsBodyInput, MenuTabsConfig, MenuTabsConfigInput, MenuTabsItem, } from './ui/menu-tabs/schema.js';
5
5
  declare const _default: typeof __VLS_export;
6
6
  export default _default;
7
7
  declare const __VLS_export: import("vue").DefineComponent<{
@@ -11,9 +11,14 @@ declare const __VLS_export: import("vue").DefineComponent<{
11
11
  "update:config": (args_0: Readonly<{
12
12
  menus: readonly Readonly<{
13
13
  id: string;
14
- title: import("../utils/coders.js").LocaleValue;
14
+ title: readonly {
15
+ locale: "zh" | "ja" | "en" | "ko";
16
+ message: string;
17
+ }[];
15
18
  to: string;
16
19
  }>[];
20
+ kind: string;
21
+ compatibilityDate: string;
17
22
  }>) => any;
18
23
  }, string, import("vue").PublicProps, Readonly<{
19
24
  config?: MenuTabsConfigInput | Effect.Effect<MenuTabsConfigInput | undefined>;
@@ -22,8 +27,13 @@ declare const __VLS_export: import("vue").DefineComponent<{
22
27
  "onUpdate:config"?: ((args_0: Readonly<{
23
28
  menus: readonly Readonly<{
24
29
  id: string;
25
- title: import("../utils/coders.js").LocaleValue;
30
+ title: readonly {
31
+ locale: "zh" | "ja" | "en" | "ko";
32
+ message: string;
33
+ }[];
26
34
  to: string;
27
35
  }>[];
36
+ kind: string;
37
+ compatibilityDate: string;
28
38
  }>) => any) | undefined;
29
39
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -3,6 +3,7 @@ type __VLS_Props = {
3
3
  defaultOpen?: boolean;
4
4
  breakpoint?: string;
5
5
  showCloseButton?: boolean;
6
+ dismissible?: boolean;
6
7
  };
7
8
  declare function close(): void;
8
9
  declare var __VLS_14: {
@@ -37,9 +38,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
37
38
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
38
39
  "onUpdate:open"?: ((open: boolean) => any) | undefined;
39
40
  }>, {
40
- defaultOpen: boolean;
41
41
  showCloseButton: boolean;
42
42
  breakpoint: string;
43
+ dismissible: boolean;
44
+ defaultOpen: boolean;
43
45
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
44
46
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
45
47
  declare const _default: typeof __VLS_export;
@@ -28,7 +28,8 @@ const props = defineProps({
28
28
  open: { type: Boolean, required: false },
29
29
  defaultOpen: { type: Boolean, required: false, default: false },
30
30
  breakpoint: { type: String, required: false, default: "(min-width: 640px)" },
31
- showCloseButton: { type: Boolean, required: false, default: true }
31
+ showCloseButton: { type: Boolean, required: false, default: true },
32
+ dismissible: { type: Boolean, required: false, default: true }
32
33
  });
33
34
  const emit = defineEmits(["update:open"]);
34
35
  const attrs = useAttrs();
@@ -81,6 +82,7 @@ function close() {
81
82
  <component
82
83
  :is="modalComponents.Root"
83
84
  v-model:open="open"
85
+ :dismissible="props.dismissible"
84
86
  >
85
87
  <component
86
88
  :is="modalComponents.Trigger"
@@ -3,6 +3,7 @@ type __VLS_Props = {
3
3
  defaultOpen?: boolean;
4
4
  breakpoint?: string;
5
5
  showCloseButton?: boolean;
6
+ dismissible?: boolean;
6
7
  };
7
8
  declare function close(): void;
8
9
  declare var __VLS_14: {
@@ -37,9 +38,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
37
38
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
38
39
  "onUpdate:open"?: ((open: boolean) => any) | undefined;
39
40
  }>, {
40
- defaultOpen: boolean;
41
41
  showCloseButton: boolean;
42
42
  breakpoint: string;
43
+ dismissible: boolean;
44
+ defaultOpen: boolean;
43
45
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
44
46
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
45
47
  declare const _default: typeof __VLS_export;
@@ -1,7 +1,8 @@
1
+ import { Effect } from 'effect';
1
2
  import type { TableConfigInput } from './ui/table/schema.js';
2
3
  export type { Accessor, Column, Expression, Markdown, Render, TableConfig, TableConfigInput } from './ui/table/schema.js';
3
4
  export type { TableInstance } from './ui/table/Table.vue.js';
4
- export { AccessorC, ColumnC, RenderC, TableConfigC } from './ui/table/schema.js';
5
+ export { AccessorC, ColumnC, CURRENT_COMPATIBILITY_DATE, KIND, RenderC, SUPPORTED_COMPATIBILITY_DATES, TableBodyC, TableBodyInputC, TableConfigC, TableConfigInputC, createTableConfig, } from './ui/table/schema.js';
5
6
  declare module '@tanstack/vue-table' {
6
7
  interface ColumnMeta<TData extends import('@tanstack/vue-table').RowData, TValue> {
7
8
  tooltip?: string;
@@ -13,11 +14,13 @@ declare module '@tanstack/vue-table' {
13
14
  declare const _default: typeof __VLS_export;
14
15
  export default _default;
15
16
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
16
- config?: TableConfigInput | import("effect").Effect.Effect<TableConfigInput | undefined>;
17
+ config?: TableConfigInput | Effect.Effect<TableConfigInput | undefined>;
17
18
  data: Array<unknown>;
18
19
  rowCount?: number;
19
20
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
21
  "update:config": (args_0: Readonly<{
22
+ kind: string;
23
+ compatibilityDate: string;
21
24
  getRowId?: import("./table.vue.js").Expression;
22
25
  getSubRows?: import("./table.vue.js").Expression;
23
26
  enableRowSelection?: import("./table.vue.js").Expression;
@@ -74,11 +77,13 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
74
77
  paginationPageSizes?: ReadonlyArray<number>;
75
78
  }>) => any;
76
79
  }, string, import("vue").PublicProps, Readonly<{
77
- config?: TableConfigInput | import("effect").Effect.Effect<TableConfigInput | undefined>;
80
+ config?: TableConfigInput | Effect.Effect<TableConfigInput | undefined>;
78
81
  data: Array<unknown>;
79
82
  rowCount?: number;
80
83
  }> & Readonly<{
81
84
  "onUpdate:config"?: ((args_0: Readonly<{
85
+ kind: string;
86
+ compatibilityDate: string;
82
87
  getRowId?: import("./table.vue.js").Expression;
83
88
  getSubRows?: import("./table.vue.js").Expression;
84
89
  enableRowSelection?: import("./table.vue.js").Expression;
@@ -1,5 +1,7 @@
1
1
  <script setup>
2
+ import { Effect } from "effect";
2
3
  import { ref } from "vue";
4
+ import { createTableConfig } from "./ui/table/schema";
3
5
  import UiTable from "./ui/table/Table.vue";
4
6
  defineOptions({
5
7
  inheritAttrs: false
@@ -10,6 +12,18 @@ const props = defineProps({
10
12
  rowCount: { type: Number, required: false }
11
13
  });
12
14
  const emit = defineEmits(["update:config"]);
15
+ const defaultConfig = createTableConfig({
16
+ columns: []
17
+ });
18
+ function isTableConfigEffect(value) {
19
+ return typeof value === "object" && value !== null && "pipe" in value && typeof value.pipe === "function";
20
+ }
21
+ function resolveConfig() {
22
+ if (isTableConfigEffect(props.config)) {
23
+ return props.config.pipe(Effect.map((value) => value ?? defaultConfig));
24
+ }
25
+ return props.config ?? defaultConfig;
26
+ }
13
27
  function handleConfigUpdate(config) {
14
28
  emit("update:config", config);
15
29
  }
@@ -43,13 +57,25 @@ defineExpose(new Proxy({}, {
43
57
  </script>
44
58
 
45
59
  <script>
46
- export { AccessorC, ColumnC, RenderC, TableConfigC } from "./ui/table/schema";
60
+ export {
61
+ AccessorC,
62
+ ColumnC,
63
+ CURRENT_COMPATIBILITY_DATE,
64
+ KIND,
65
+ RenderC,
66
+ SUPPORTED_COMPATIBILITY_DATES,
67
+ TableBodyC,
68
+ TableBodyInputC,
69
+ TableConfigC,
70
+ TableConfigInputC,
71
+ createTableConfig
72
+ } from "./ui/table/schema";
47
73
  </script>
48
74
 
49
75
  <template>
50
76
  <UiTable
51
77
  ref="tableRef"
52
- :config="props.config"
78
+ :config="resolveConfig()"
53
79
  :data="props.data"
54
80
  :row-count="props.rowCount"
55
81
  @update:config="handleConfigUpdate"
@@ -1,7 +1,8 @@
1
+ import { Effect } from 'effect';
1
2
  import type { TableConfigInput } from './ui/table/schema.js';
2
3
  export type { Accessor, Column, Expression, Markdown, Render, TableConfig, TableConfigInput } from './ui/table/schema.js';
3
4
  export type { TableInstance } from './ui/table/Table.vue.js';
4
- export { AccessorC, ColumnC, RenderC, TableConfigC } from './ui/table/schema.js';
5
+ export { AccessorC, ColumnC, CURRENT_COMPATIBILITY_DATE, KIND, RenderC, SUPPORTED_COMPATIBILITY_DATES, TableBodyC, TableBodyInputC, TableConfigC, TableConfigInputC, createTableConfig, } from './ui/table/schema.js';
5
6
  declare module '@tanstack/vue-table' {
6
7
  interface ColumnMeta<TData extends import('@tanstack/vue-table').RowData, TValue> {
7
8
  tooltip?: string;
@@ -13,11 +14,13 @@ declare module '@tanstack/vue-table' {
13
14
  declare const _default: typeof __VLS_export;
14
15
  export default _default;
15
16
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
16
- config?: TableConfigInput | import("effect").Effect.Effect<TableConfigInput | undefined>;
17
+ config?: TableConfigInput | Effect.Effect<TableConfigInput | undefined>;
17
18
  data: Array<unknown>;
18
19
  rowCount?: number;
19
20
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
21
  "update:config": (args_0: Readonly<{
22
+ kind: string;
23
+ compatibilityDate: string;
21
24
  getRowId?: import("./table.vue.js").Expression;
22
25
  getSubRows?: import("./table.vue.js").Expression;
23
26
  enableRowSelection?: import("./table.vue.js").Expression;
@@ -74,11 +77,13 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
74
77
  paginationPageSizes?: ReadonlyArray<number>;
75
78
  }>) => any;
76
79
  }, string, import("vue").PublicProps, Readonly<{
77
- config?: TableConfigInput | import("effect").Effect.Effect<TableConfigInput | undefined>;
80
+ config?: TableConfigInput | Effect.Effect<TableConfigInput | undefined>;
78
81
  data: Array<unknown>;
79
82
  rowCount?: number;
80
83
  }> & Readonly<{
81
84
  "onUpdate:config"?: ((args_0: Readonly<{
85
+ kind: string;
86
+ compatibilityDate: string;
82
87
  getRowId?: import("./table.vue.js").Expression;
83
88
  getSubRows?: import("./table.vue.js").Expression;
84
89
  enableRowSelection?: import("./table.vue.js").Expression;
@@ -1,13 +1,15 @@
1
1
  import type { Scope } from 'effect';
2
2
  import { Effect } from 'effect';
3
+ import { type OverlayService as OverlayRuntimeService } from '../../../composables/useOverlay.js';
3
4
  import { type Sidebar as SidebarType } from '../../../composables/useNavigationTabs.js';
5
+ type UiCommandEffect = Effect.Effect<void, never, Scope.Scope | OverlayRuntimeService>;
4
6
  type ProfileCommandInputItem = Readonly<{
5
7
  id: string | number;
6
8
  title: string;
7
9
  icon?: string;
8
10
  hidden?: boolean;
9
11
  disabled?: boolean;
10
- effect?: Effect.Effect<void>;
12
+ effect?: UiCommandEffect;
11
13
  keywords?: Array<string>;
12
14
  }>;
13
15
  type ProfileCommandInputGroup = Readonly<{
@@ -67,13 +69,13 @@ type __VLS_Props = {
67
69
  */
68
70
  commands?: Array<ProfileCommandInputItem | ProfileCommandInputGroup>;
69
71
  };
70
- declare var __VLS_108: {}, __VLS_124: {}, __VLS_347: {};
72
+ declare var __VLS_113: {}, __VLS_129: {}, __VLS_352: {};
71
73
  type __VLS_Slots = {} & {
72
- menu?: (props: typeof __VLS_108) => any;
74
+ menu?: (props: typeof __VLS_113) => any;
73
75
  } & {
74
- profile?: (props: typeof __VLS_124) => any;
76
+ profile?: (props: typeof __VLS_129) => any;
75
77
  } & {
76
- default?: (props: typeof __VLS_347) => any;
78
+ default?: (props: typeof __VLS_352) => any;
77
79
  };
78
80
  declare const __VLS_base: 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>;
79
81
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -8,6 +8,8 @@ import { useMagicKeys, useTimeoutFn, whenever } from "@vueuse/core";
8
8
  import { useI18n } from "vue-i18n";
9
9
  import { Icon } from "@iconify/vue";
10
10
  import { Effect } from "effect";
11
+ import OverlayHost from "./OverlayHost.vue";
12
+ import { provideOverlay, useOverlay } from "../../../composables/useOverlay";
11
13
  import { setGlobalDslContext } from "../../../plugins/cel/context";
12
14
  import { Sidebar, SidebarContent, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarMenu, SidebarMenuAction, SidebarMenuButton, SidebarMenuItem, SidebarProvider } from "../sidebar";
13
15
  import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../collapsible";
@@ -22,6 +24,7 @@ const {
22
24
  } = useRuntimeConfig();
23
25
  const { $dsl } = useNuxtApp();
24
26
  const { t } = useI18n();
27
+ const overlay = useOverlay();
25
28
  const props = defineProps({
26
29
  dsl: { type: null, required: false },
27
30
  sidebar: { type: Array, required: false },
@@ -59,12 +62,28 @@ const logout = () => {
59
62
  }
60
63
  return Effect.void;
61
64
  };
65
+ function runUiEffect(effect) {
66
+ if (!effect) {
67
+ return Promise.resolve();
68
+ }
69
+ return Effect.runPromise(Effect.scoped(provideOverlay(effect, overlay)));
70
+ }
71
+ function runPaletteEffect(effect) {
72
+ if (!effect) {
73
+ return Promise.resolve();
74
+ }
75
+ const effectWithClose = effect.pipe(Effect.tap(() => {
76
+ ui.isCommandPaletteOpen = false;
77
+ }));
78
+ return Effect.runPromise(Effect.scoped(provideOverlay(effectWithClose, overlay)));
79
+ }
62
80
  </script>
63
81
 
64
82
  <template>
65
83
  <TooltipProvider>
66
84
  <ClientOnly>
67
85
  <Toaster />
86
+ <OverlayHost />
68
87
  <CommandDialog
69
88
  v-model:open="ui.isCommandPaletteOpen"
70
89
  >
@@ -95,9 +114,7 @@ const logout = () => {
95
114
  :key="child.id"
96
115
  :value="child.id"
97
116
  :disabled="child.disabled"
98
- @select="child.effect?.pipe(Effect.tap(() => {
99
- ui.isCommandPaletteOpen = false;
100
- })).pipe(Effect.runPromise)"
117
+ @select="void runPaletteEffect(child.effect)"
101
118
  >
102
119
  <span>{{ child.title }}</span>
103
120
  <span class="sr-only">
@@ -109,9 +126,7 @@ const logout = () => {
109
126
  <CommandItem
110
127
  :value="command.id"
111
128
  :disabled="command.disabled"
112
- @select="command.effect?.pipe(Effect.tap(() => {
113
- ui.isCommandPaletteOpen = false;
114
- })).pipe(Effect.runPromise)"
129
+ @select="void runPaletteEffect(command.effect)"
115
130
  >
116
131
  <span>{{ command.title }}</span>
117
132
  <span class="sr-only">
@@ -198,7 +213,7 @@ const logout = () => {
198
213
  <DropdownMenuItem
199
214
  v-if="!child.hidden"
200
215
  :disabled="child.disabled"
201
- @select="child.effect?.pipe(Effect.runPromise)"
216
+ @select="void runUiEffect(child.effect)"
202
217
  >
203
218
  <Icon
204
219
  v-if="child.icon"
@@ -213,7 +228,7 @@ const logout = () => {
213
228
  <DropdownMenuItem
214
229
  v-else-if="!('children' in command) && !command.hidden"
215
230
  :disabled="command.disabled"
216
- @select="command.effect?.pipe(Effect.runPromise)"
231
+ @select="void runUiEffect(command.effect)"
217
232
  >
218
233
  <Icon
219
234
  v-if="command.icon"
@@ -1,13 +1,15 @@
1
1
  import type { Scope } from 'effect';
2
2
  import { Effect } from 'effect';
3
+ import { type OverlayService as OverlayRuntimeService } from '../../../composables/useOverlay.js';
3
4
  import { type Sidebar as SidebarType } from '../../../composables/useNavigationTabs.js';
5
+ type UiCommandEffect = Effect.Effect<void, never, Scope.Scope | OverlayRuntimeService>;
4
6
  type ProfileCommandInputItem = Readonly<{
5
7
  id: string | number;
6
8
  title: string;
7
9
  icon?: string;
8
10
  hidden?: boolean;
9
11
  disabled?: boolean;
10
- effect?: Effect.Effect<void>;
12
+ effect?: UiCommandEffect;
11
13
  keywords?: Array<string>;
12
14
  }>;
13
15
  type ProfileCommandInputGroup = Readonly<{
@@ -67,13 +69,13 @@ type __VLS_Props = {
67
69
  */
68
70
  commands?: Array<ProfileCommandInputItem | ProfileCommandInputGroup>;
69
71
  };
70
- declare var __VLS_108: {}, __VLS_124: {}, __VLS_347: {};
72
+ declare var __VLS_113: {}, __VLS_129: {}, __VLS_352: {};
71
73
  type __VLS_Slots = {} & {
72
- menu?: (props: typeof __VLS_108) => any;
74
+ menu?: (props: typeof __VLS_113) => any;
73
75
  } & {
74
- profile?: (props: typeof __VLS_124) => any;
76
+ profile?: (props: typeof __VLS_129) => any;
75
77
  } & {
76
- default?: (props: typeof __VLS_347) => any;
78
+ default?: (props: typeof __VLS_352) => any;
77
79
  };
78
80
  declare const __VLS_base: 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>;
79
81
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,91 @@
1
+ <script setup>
2
+ import { computed, defineComponent } from "vue";
3
+ import ShwfedModal from "../../modal.vue";
4
+ import { useOverlay } from "../../../composables/useOverlay";
5
+ const overlay = useOverlay();
6
+ const OverlayBody = defineComponent({
7
+ name: "OverlayBody",
8
+ props: {
9
+ render: {
10
+ type: Function,
11
+ required: true
12
+ },
13
+ slotProps: {
14
+ type: Object,
15
+ required: true
16
+ }
17
+ },
18
+ setup(props) {
19
+ return () => props.render(props.slotProps);
20
+ }
21
+ });
22
+ function handleOpenUpdate(sessionId, open) {
23
+ if (open) {
24
+ return;
25
+ }
26
+ overlay.closeSync(sessionId, {
27
+ _tag: "OverlayAborted",
28
+ reason: "dismiss"
29
+ });
30
+ }
31
+ const renderedSessions = computed(() => {
32
+ const nextSessions = [];
33
+ for (const session of overlay.sessions) {
34
+ const definition = overlay.definitions[session.definitionId];
35
+ if (!definition) {
36
+ continue;
37
+ }
38
+ nextSessions.push({
39
+ sessionId: session.sessionId,
40
+ definitionId: session.definitionId,
41
+ shell: session.shell,
42
+ props: session.props,
43
+ definition
44
+ });
45
+ }
46
+ return nextSessions;
47
+ });
48
+ </script>
49
+
50
+ <template>
51
+ <template
52
+ v-for="session in renderedSessions"
53
+ :key="session.sessionId"
54
+ >
55
+ <ShwfedModal
56
+ :open="true"
57
+ :breakpoint="session.shell.breakpoint"
58
+ :show-close-button="session.shell.showCloseButton"
59
+ :dismissible="session.shell.dismissible"
60
+ @update:open="handleOpenUpdate(session.sessionId, $event)"
61
+ >
62
+ <template
63
+ v-if="session.shell.title"
64
+ #title
65
+ >
66
+ {{ session.shell.title }}
67
+ </template>
68
+
69
+ <template
70
+ v-if="session.shell.description"
71
+ #description
72
+ >
73
+ {{ session.shell.description }}
74
+ </template>
75
+
76
+ <template #default="modalSlotProps">
77
+ <OverlayBody
78
+ :render="session.definition.render"
79
+ :slot-props="{
80
+ props: session.props,
81
+ shell: session.shell,
82
+ sessionId: session.sessionId,
83
+ close: (value) => overlay.closeSync(session.sessionId, value),
84
+ patch: (nextProps) => overlay.patchSync(session.sessionId, { props: nextProps }),
85
+ isDesktop: modalSlotProps.isDesktop
86
+ }"
87
+ />
88
+ </template>
89
+ </ShwfedModal>
90
+ </template>
91
+ </template>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -24,6 +24,19 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
24
24
  icon?: string | undefined;
25
25
  variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
26
26
  hideTitle?: boolean | undefined;
27
+ modal?: Readonly<{
28
+ title?: readonly {
29
+ locale: "zh" | "ja" | "en" | "ko";
30
+ message: string;
31
+ }[] | undefined;
32
+ description?: readonly {
33
+ locale: "zh" | "ja" | "en" | "ko";
34
+ message: string;
35
+ }[] | undefined;
36
+ showCloseButton?: boolean | undefined;
37
+ breakpoint?: string | undefined;
38
+ dismissible?: boolean | undefined;
39
+ }> | undefined;
27
40
  }> | Readonly<{
28
41
  id: string;
29
42
  title: readonly {
@@ -42,10 +55,25 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
42
55
  }[] | undefined;
43
56
  icon?: string | undefined;
44
57
  variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
58
+ modal?: Readonly<{
59
+ title?: readonly {
60
+ locale: "zh" | "ja" | "en" | "ko";
61
+ message: string;
62
+ }[] | undefined;
63
+ description?: readonly {
64
+ locale: "zh" | "ja" | "en" | "ko";
65
+ message: string;
66
+ }[] | undefined;
67
+ showCloseButton?: boolean | undefined;
68
+ breakpoint?: string | undefined;
69
+ dismissible?: boolean | undefined;
70
+ }> | undefined;
45
71
  }>[];
46
72
  icon?: string | undefined;
47
73
  }>)[];
48
74
  }>[];
75
+ kind: string;
76
+ compatibilityDate: string;
49
77
  gap?: number | undefined;
50
78
  style?: string | undefined;
51
79
  }>) => any;
@@ -67,6 +95,19 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
67
95
  icon?: string | undefined;
68
96
  variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
69
97
  hideTitle?: boolean | undefined;
98
+ modal?: Readonly<{
99
+ title?: readonly {
100
+ locale: "zh" | "ja" | "en" | "ko";
101
+ message: string;
102
+ }[] | undefined;
103
+ description?: readonly {
104
+ locale: "zh" | "ja" | "en" | "ko";
105
+ message: string;
106
+ }[] | undefined;
107
+ showCloseButton?: boolean | undefined;
108
+ breakpoint?: string | undefined;
109
+ dismissible?: boolean | undefined;
110
+ }> | undefined;
70
111
  }> | Readonly<{
71
112
  id: string;
72
113
  title: readonly {
@@ -85,10 +126,25 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
85
126
  }[] | undefined;
86
127
  icon?: string | undefined;
87
128
  variant?: "default" | "destructive" | "primary" | "ghost" | undefined;
129
+ modal?: Readonly<{
130
+ title?: readonly {
131
+ locale: "zh" | "ja" | "en" | "ko";
132
+ message: string;
133
+ }[] | undefined;
134
+ description?: readonly {
135
+ locale: "zh" | "ja" | "en" | "ko";
136
+ message: string;
137
+ }[] | undefined;
138
+ showCloseButton?: boolean | undefined;
139
+ breakpoint?: string | undefined;
140
+ dismissible?: boolean | undefined;
141
+ }> | undefined;
88
142
  }>[];
89
143
  icon?: string | undefined;
90
144
  }>)[];
91
145
  }>[];
146
+ kind: string;
147
+ compatibilityDate: string;
92
148
  gap?: number | undefined;
93
149
  style?: string | undefined;
94
150
  }>) => any) | undefined;