@antelopejs/dms 0.3.5 → 0.3.7

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.3.7
4
+
5
+ [compare changes](https://github.com/AntelopeJS/dms/compare/v0.3.6...v0.3.7)
6
+
7
+ ### 🩹 Fixes
8
+
9
+ - **ui:** Let Grid drop columns instead of overflowing its container ([#26](https://github.com/AntelopeJS/dms/pull/26))
10
+
11
+ ### 🏡 Chore
12
+
13
+ - Make playground orb setup reliable ([#23](https://github.com/AntelopeJS/dms/pull/23))
14
+ - **playground:** Use dms frontend 0.2.1 ([#24](https://github.com/AntelopeJS/dms/pull/24))
15
+
16
+ ### ❤️ Contributors
17
+
18
+ - Antony Rizzitelli <rizzitelli.antony@pm.me>
19
+
20
+ ## v0.3.6
21
+
22
+ [compare changes](https://github.com/AntelopeJS/dms/compare/v0.3.5...v0.3.6)
23
+
24
+ ### 🩹 Fixes
25
+
26
+ - **frontend:** Match sidebar search design ([#21](https://github.com/AntelopeJS/dms/pull/21))
27
+
28
+ ### 🏡 Chore
29
+
30
+ - Migrate dms frontend commands to ajs plugin ([#22](https://github.com/AntelopeJS/dms/pull/22))
31
+
32
+ ### ❤️ Contributors
33
+
34
+ - Antony Rizzitelli <rizzitelli.antony@pm.me>
35
+
3
36
  ## v0.3.5
4
37
 
5
38
  [compare changes](https://github.com/AntelopeJS/dms/compare/v0.3.4...v0.3.5)
package/README.md CHANGED
@@ -20,7 +20,7 @@ ajs project modules add @antelopejs/dms
20
20
  ```
21
21
 
22
22
  The dashboard also requires an API module, a module implementing the Database interface, and an
23
- authentication module. The frontend is served separately by the `ajs-dms` CLI from
23
+ authentication module. The frontend is served separately by the `ajs dms` CLI from
24
24
  [`@antelopejs/dms-frontend`](https://github.com/AntelopeJS/dms-frontend).
25
25
 
26
26
  ## Getting started
@@ -277,7 +277,17 @@ const footerItems = computed((): NavigationMenuItem[] => {
277
277
 
278
278
  <UDashboardSearchButton
279
279
  :collapsed="collapsed"
280
- class="bg-elevated ring-default"
280
+ :label="t('commandPalette.button')"
281
+ :kbds="['⌘K']"
282
+ icon="i-ph-magnifying-glass-light"
283
+ variant="outline"
284
+ class="border-default bg-elevated text-dimmed hover:border-accented hover:bg-elevated hover:text-muted w-full justify-between rounded-md border px-2.5 py-2 text-[12.5px] font-normal"
285
+ :ui="{
286
+ base: 'gap-2',
287
+ leadingIcon: 'size-[15px]',
288
+ trailing:
289
+ '[&>kbd]:rounded-[4px] [&>kbd]:border [&>kbd]:border-accented [&>kbd]:px-[5px] [&>kbd]:py-px [&>kbd]:text-[10px] [&>kbd]:font-normal [&>kbd]:tracking-normal',
290
+ }"
281
291
  />
282
292
 
283
293
  <div
@@ -43,6 +43,7 @@
43
43
  "title": "Quick actions"
44
44
  },
45
45
  "commandPalette": {
46
+ "button": "Search…",
46
47
  "dialog": {
47
48
  "title": "Search",
48
49
  "description": "Search pages, actions and settings"
@@ -43,6 +43,7 @@
43
43
  "title": "Actions rapides"
44
44
  },
45
45
  "commandPalette": {
46
+ "button": "Rechercher…",
46
47
  "dialog": {
47
48
  "title": "Recherche",
48
49
  "description": "Rechercher des pages, des actions et des réglages"
@@ -1,13 +1,16 @@
1
1
  <script setup lang="ts">
2
2
  import type { DefaultComponentProps } from "../../../../dms-core/app/types/component";
3
3
  import { GRID_CONTEXT, type GridContext } from "./constants";
4
+ import { GRID_DEFAULT_MIN_COLUMN_WIDTH, gridColumnsTemplate } from "./columns";
4
5
 
5
6
  interface GridProps extends DefaultComponentProps {
6
7
  gap?: string;
8
+ minColumnWidth?: string;
7
9
  }
8
10
 
9
11
  const props = withDefaults(defineProps<GridProps>(), {
10
12
  gap: "1rem",
13
+ minColumnWidth: GRID_DEFAULT_MIN_COLUMN_WIDTH,
11
14
  });
12
15
 
13
16
  const rowColumnCounts = ref<number[]>([]);
@@ -18,6 +21,7 @@ const maxColumns = computed(() => {
18
21
  });
19
22
 
20
23
  const gapRef = computed(() => props.gap);
24
+ const minColumnWidthRef = computed(() => props.minColumnWidth);
21
25
 
22
26
  provide<GridContext>(GRID_CONTEXT, {
23
27
  registerRowColumnCount: (columnCount: number) => {
@@ -25,11 +29,16 @@ provide<GridContext>(GRID_CONTEXT, {
25
29
  },
26
30
  maxColumns,
27
31
  gap: gapRef,
32
+ minColumnWidth: minColumnWidthRef,
28
33
  });
29
34
 
30
35
  const gridStyle = computed(() => ({
31
36
  display: "grid",
32
- gridTemplateColumns: `repeat(${maxColumns.value}, 1fr)`,
37
+ gridTemplateColumns: gridColumnsTemplate(
38
+ maxColumns.value,
39
+ props.gap,
40
+ props.minColumnWidth,
41
+ ),
33
42
  gap: props.gap,
34
43
  width: "100%",
35
44
  }));
@@ -1,9 +1,12 @@
1
1
  <script setup lang="ts">
2
2
  import type { DefaultComponentProps } from "../../../../dms-core/app/types/component";
3
3
  import { GRID_CONTEXT, type GridContext } from "./constants";
4
+ import { GRID_DEFAULT_MIN_COLUMN_WIDTH, gridColumnsTemplate } from "./columns";
4
5
 
5
6
  interface GridRowProps extends DefaultComponentProps {}
6
7
 
8
+ const DEFAULT_GAP = "1rem";
9
+
7
10
  const props = defineProps<GridRowProps>();
8
11
 
9
12
  const gridContext = inject<GridContext>(GRID_CONTEXT);
@@ -13,12 +16,19 @@ if (gridContext) {
13
16
  gridContext.registerRowColumnCount(columnCount);
14
17
  }
15
18
 
16
- const rowStyle = computed(() => ({
17
- gridColumn: "1 / -1",
18
- display: "grid",
19
- gridTemplateColumns: `repeat(${gridContext?.maxColumns.value || 1}, 1fr)`,
20
- gap: gridContext?.gap.value ?? "1rem",
21
- }));
19
+ const rowStyle = computed(() => {
20
+ const gap = gridContext?.gap.value ?? DEFAULT_GAP;
21
+ return {
22
+ gridColumn: "1 / -1",
23
+ display: "grid",
24
+ gridTemplateColumns: gridColumnsTemplate(
25
+ gridContext?.maxColumns.value || 1,
26
+ gap,
27
+ gridContext?.minColumnWidth.value ?? GRID_DEFAULT_MIN_COLUMN_WIDTH,
28
+ ),
29
+ gap,
30
+ };
31
+ });
22
32
  </script>
23
33
 
24
34
  <template>
@@ -0,0 +1,29 @@
1
+ const SINGLE_COLUMN = 1;
2
+
3
+ /** Track floor below which a column stops being usable, as a CSS length. */
4
+ export const GRID_DEFAULT_MIN_COLUMN_WIDTH = "240px";
5
+
6
+ /**
7
+ * The column track template a `Grid` and every `GridRow` inside it share.
8
+ *
9
+ * `auto-fill` drops tracks as the container narrows, which is what makes the
10
+ * grid responsive without a breakpoint list. The track floor is the larger of
11
+ * `minColumnWidth` and the width one column would have at `maxColumns`: once
12
+ * the container is wide enough, that share exceeds `minColumnWidth` and leaves
13
+ * no room for an extra track, so `auto-fill` settles on exactly `maxColumns`
14
+ * and the wide layout stays what it was. The outer `min(100%, ...)` keeps a
15
+ * container narrower than `minColumnWidth` from overflowing it.
16
+ *
17
+ * Rows resolve this same template against the same width, so they keep lining
18
+ * up on one another — what `maxColumns` was introduced for — at every width
19
+ * rather than only at the widest.
20
+ */
21
+ export function gridColumnsTemplate(
22
+ maxColumns: number,
23
+ gap: string,
24
+ minColumnWidth: string,
25
+ ): string {
26
+ const columns = Math.max(maxColumns, SINGLE_COLUMN);
27
+ const columnShare = `(100% - ${columns - SINGLE_COLUMN} * ${gap}) / ${columns}`;
28
+ return `repeat(auto-fill, minmax(min(100%, max(${minColumnWidth}, ${columnShare})), 1fr))`;
29
+ }
@@ -4,4 +4,5 @@ export interface GridContext {
4
4
  registerRowColumnCount: (count: number) => void;
5
5
  maxColumns: ComputedRef<number>;
6
6
  gap: ComputedRef<string>;
7
+ minColumnWidth: ComputedRef<string>;
7
8
  }
@@ -11,13 +11,13 @@
11
11
  "license": "Apache-2.0",
12
12
  "packageManager": "pnpm@10.6.5",
13
13
  "scripts": {
14
- "typecheck": "ajs-dms verify-source --layer \"$PWD\" --local-package @antelopejs/dms=.. --local-package @antelopejs/interface-dms=../../interface-dms",
14
+ "typecheck": "ajs dms verify-source --layer \"$PWD\" --local-package @antelopejs/dms=.. --local-package @antelopejs/interface-dms=../../interface-dms",
15
15
  "test": "vitest run",
16
16
  "format": "prettier --write .",
17
17
  "lint": "eslint .",
18
18
  "lint:fix": "eslint . --fix",
19
- "frontend:build": "ajs-dms build -b http://127.0.0.1:5010",
20
- "frontend:start": "ajs-dms start -p 3001"
19
+ "frontend:build": "ajs dms build -b http://127.0.0.1:5010",
20
+ "frontend:start": "ajs dms start -p 3001"
21
21
  },
22
22
  "dependencies": {
23
23
  "@iconify-json/lucide": "^1.2.64",
@@ -58,6 +58,7 @@
58
58
  "zod": "^3.24.2"
59
59
  },
60
60
  "devDependencies": {
61
+ "@antelopejs/core": ">=1.8.0 <2",
61
62
  "@antelopejs/dms-frontend": ">=0.2.0 <1.0.0",
62
63
  "@eslint/js": "^8.57.0",
63
64
  "@inertiajs/vue3": "^3.7.0",