@aerogel/core 0.1.1-next.3efa6858f5942a7048392e08e88f511c6c5ca343 → 0.1.1-next.6005e06a52b9294023bae608af05bf826d281a4d

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.
@@ -1,11 +1,10 @@
1
1
  <template>
2
2
  <Modal
3
3
  persistent
4
- class="flex"
5
4
  wrapper-class="w-auto"
6
5
  :title="renderedTitle"
7
6
  :title-hidden
8
- :class="{ 'flex-col-reverse': showProgress, 'items-center justify-center gap-2': !showProgress }"
7
+ :class="{ 'flex-col-reverse': showProgress, 'flex-row items-center justify-center gap-2': !showProgress }"
9
8
  >
10
9
  <ProgressBar
11
10
  v-if="showProgress"
@@ -95,7 +95,7 @@ const {
95
95
  persistent,
96
96
  closeHidden,
97
97
  fullscreen,
98
- fullscreenMobile,
98
+ fullscreenOnMobile,
99
99
  ...props
100
100
  } = defineProps<
101
101
  ModalProps & {
@@ -122,11 +122,11 @@ const hasRenderedModals = computed(() => modals.value.some((modal) => renderedMo
122
122
  const contentProps = computed(() => (description ? {} : { 'aria-describedby': undefined }));
123
123
  const renderedContentClass = computed(() =>
124
124
  classes(
125
- 'overflow-auto px-4 pb-4',
125
+ 'overflow-auto px-4 pb-4 flex flex-col flex-1',
126
126
  { 'pt-4': !title || titleHidden, 'max-h-[90vh]': !renderFullscreen.value },
127
127
  contentClass,
128
128
  ));
129
- const renderFullscreen = computed(() => fullscreen || (fullscreenMobile && UI.mobile));
129
+ const renderFullscreen = computed(() => fullscreen || (fullscreenOnMobile && UI.mobile));
130
130
  const renderedWrapperClass = computed(() =>
131
131
  classes(
132
132
  'isolate fixed z-50 flex flex-col overflow-hidden bg-white text-left duration-300',
@@ -1,6 +1,11 @@
1
1
  <template>
2
- <div class="mt-1 h-2 w-full overflow-hidden rounded-full bg-gray-200">
2
+ <div class="relative mt-1 h-2 w-full overflow-hidden rounded-full bg-gray-200">
3
3
  <div :class="filledClasses" :style="`transform:translateX(-${(1 - renderedProgress) * 100}%)`" />
4
+ <div
5
+ v-if="overflowWidthPercentage"
6
+ :class="overflowClasses"
7
+ :style="{ width: `${overflowWidthPercentage}%` }"
8
+ />
4
9
  <span class="sr-only">
5
10
  {{
6
11
  $td('ui.progress', '{progress}% complete', {
@@ -18,8 +23,9 @@ import { classes } from '@aerogel/core/utils/classes';
18
23
  import type Job from '@aerogel/core/jobs/Job';
19
24
  import type { Falsifiable } from '@aerogel/core/utils';
20
25
 
21
- const { filledClass, progress, job } = defineProps<{
26
+ const { filledClass, overflowClass, progress, job } = defineProps<{
22
27
  filledClass?: string;
28
+ overflowClass?: string;
23
29
  progress?: number;
24
30
  job?: Falsifiable<Job>;
25
31
  }>();
@@ -28,6 +34,12 @@ let cleanup: Falsifiable<Function>;
28
34
  const jobProgress = ref(0);
29
35
  const filledClasses = computed(() =>
30
36
  classes('size-full transition-transform duration-500 rounded-r-full ease-linear bg-primary-600', filledClass));
37
+ const overflowClasses = computed(() =>
38
+ classes(
39
+ 'absolute inset-y-0 right-0 size-full rounded-r-full',
40
+ 'bg-primary-900 transition-[width] duration-500 ease-linear',
41
+ overflowClass,
42
+ ));
31
43
  const renderedProgress = computed(() => {
32
44
  if (typeof progress === 'number') {
33
45
  return progress;
@@ -35,6 +47,8 @@ const renderedProgress = computed(() => {
35
47
 
36
48
  return jobProgress.value;
37
49
  });
50
+ const overflowWidthPercentage = computed(() =>
51
+ renderedProgress.value > 1 ? 100 * ((renderedProgress.value - 1) / renderedProgress.value) : null);
38
52
 
39
53
  watch(
40
54
  () => job,
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <Modal :title="$td('settings.title', 'Settings')">
2
+ <Modal :title="$td('settings.title', 'Settings')" :fullscreen-on-mobile="$app.settingsFullscreenOnMobile">
3
3
  <component :is="setting.component" v-for="(setting, key) in settings" :key />
4
4
  </Modal>
5
5
  </template>
@@ -2,6 +2,11 @@ export { default as AdvancedOptions } from './AdvancedOptions.vue';
2
2
  export { default as AlertModal } from './AlertModal.vue';
3
3
  export { default as Button } from './Button.vue';
4
4
  export { default as Checkbox } from './Checkbox.vue';
5
+ export { default as Combobox } from './Combobox.vue';
6
+ export { default as ComboboxLabel } from './ComboboxLabel.vue';
7
+ export { default as ComboboxOption } from './ComboboxOption.vue';
8
+ export { default as ComboboxOptions } from './ComboboxOptions.vue';
9
+ export { default as ComboboxTrigger } from './ComboboxTrigger.vue';
5
10
  export { default as ConfirmModal } from './ConfirmModal.vue';
6
11
  export { default as Details } from './Details.vue';
7
12
  export { default as DropdownMenu } from './DropdownMenu.vue';
@@ -0,0 +1,11 @@
1
+ <template>
2
+ <slot />
3
+ </template>
4
+
5
+ <script setup lang="ts">
6
+ import { provide } from 'vue';
7
+
8
+ const { name, value } = defineProps<{ name: string; value: unknown }>();
9
+
10
+ provide(name, value);
11
+ </script>
@@ -0,0 +1 @@
1
+ export { default as Provide } from './Provide.vue';
@@ -1,6 +1,7 @@
1
1
  import { JSError, facade, isDevelopment, isObject, isTesting, objectWithoutEmpty, toString } from '@noeldemartin/utils';
2
2
  import { watchEffect } from 'vue';
3
3
  import type Eruda from 'eruda';
4
+ import type ErudaIndexedDB from 'eruda-indexeddb';
4
5
 
5
6
  import App from '@aerogel/core/services/App';
6
7
  import ServiceBootError from '@aerogel/core/errors/ServiceBootError';
@@ -16,6 +17,7 @@ export class ErrorsService extends Service {
16
17
  public forceReporting: boolean = false;
17
18
  private enabled: boolean = true;
18
19
  private eruda: typeof Eruda | null = null;
20
+ private erudaPlugins: [typeof ErudaIndexedDB] | null = null;
19
21
 
20
22
  public enable(): void {
21
23
  this.enabled = true;
@@ -131,8 +133,10 @@ export class ErrorsService extends Service {
131
133
  }
132
134
 
133
135
  this.eruda ??= (await import('eruda')).default;
136
+ this.erudaPlugins ??= [(await import('eruda-indexeddb')).default];
134
137
 
135
138
  this.eruda.init();
139
+ this.erudaPlugins.forEach((plugin) => this.eruda?.add(plugin));
136
140
  });
137
141
  }
138
142
 
package/src/index.css CHANGED
@@ -20,6 +20,7 @@
20
20
  --color-primary-950: color-mix(in oklab, var(--color-primary-600) 50%, black);
21
21
 
22
22
  --color-background: oklch(1 0 0);
23
+ --color-primary-text: var(--color-gray-900);
23
24
  --color-links: var(--color-primary);
24
25
 
25
26
  --breakpoint-content: var(--breakpoint-md);
@@ -24,6 +24,7 @@ export default defineServiceState({
24
24
  version: Aerogel.version,
25
25
  sourceUrl: Aerogel.sourceUrl,
26
26
  settings: [] as AppSetting[],
27
+ settingsFullscreenOnMobile: false,
27
28
  },
28
29
  computed: {
29
30
  development: (state) => state.environment === 'development',
@@ -30,6 +30,10 @@ export class AppService extends Service {
30
30
  this.settings.push(markRaw(setting));
31
31
  }
32
32
 
33
+ public setSettingsFullscreenOnMobile(fullscreenOnMobile: boolean): void {
34
+ this.settingsFullscreenOnMobile = fullscreenOnMobile;
35
+ }
36
+
33
37
  public async whenReady<T>(callback: () => T): Promise<T> {
34
38
  const result = await this.ready.then(callback);
35
39
 
@@ -56,6 +56,10 @@ export default definePlugin({
56
56
  app.use(getPiniaStore());
57
57
  options.settings?.forEach((setting) => App.addSetting(setting));
58
58
 
59
+ if (options.settingsFullscreenOnMobile !== undefined) {
60
+ App.setSettingsFullscreenOnMobile(options.settingsFullscreenOnMobile);
61
+ }
62
+
59
63
  await bootServices(app, services);
60
64
  },
61
65
  });
@@ -64,6 +68,7 @@ declare module '@aerogel/core/bootstrap/options' {
64
68
  export interface AerogelOptions {
65
69
  services?: Record<string, Service>;
66
70
  settings?: AppSetting[];
71
+ settingsFullscreenOnMobile?: boolean;
67
72
  }
68
73
  }
69
74