@aphexcms/cms-core 2.0.1 → 2.0.3
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/dist/components/AdminApp.svelte +7 -6
- package/dist/components/AdminApp.svelte.d.ts.map +1 -1
- package/dist/components/admin/AdminLayout.svelte.d.ts +3 -3
- package/dist/components/admin/DocumentEditor.svelte +1 -1
- package/dist/components/admin/fields/ReferenceField.svelte +3 -2
- package/dist/components/admin/fields/ReferenceField.svelte.d.ts.map +1 -1
- package/dist/components/layout/sidebar/AppSidebar.svelte.d.ts +8 -1
- package/dist/components/layout/sidebar/AppSidebar.svelte.d.ts.map +1 -1
- package/dist/lib/utils/pluralize.d.ts +6 -0
- package/dist/lib/utils/pluralize.d.ts.map +1 -0
- package/dist/lib/utils/pluralize.js +16 -0
- package/dist/lib/utils/pluralize.js.map +1 -0
- package/dist/utils/pluralize.d.ts +6 -0
- package/dist/utils/pluralize.d.ts.map +1 -0
- package/dist/utils/pluralize.js +15 -0
- package/package.json +1 -1
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
import type { Organization } from '../types/organization';
|
|
32
32
|
import { getOrderingsForSchema } from '../utils/default-orderings';
|
|
33
33
|
import { cmsLogger } from '../utils/logger';
|
|
34
|
+
import { pluralize } from '../utils/pluralize';
|
|
34
35
|
import { toast } from 'svelte-sonner';
|
|
35
36
|
|
|
36
37
|
interface Props {
|
|
@@ -785,8 +786,8 @@
|
|
|
785
786
|
</button>
|
|
786
787
|
<span class="text-muted-foreground mx-2">/</span>
|
|
787
788
|
<span class="text-sm font-medium">
|
|
788
|
-
{(documentTypes.find((t) => t.name === selectedDocumentType)?.title ||
|
|
789
|
-
selectedDocumentType)
|
|
789
|
+
{pluralize(documentTypes.find((t) => t.name === selectedDocumentType)?.title ||
|
|
790
|
+
selectedDocumentType)}
|
|
790
791
|
</span>
|
|
791
792
|
{:else if mobileView === 'editor'}
|
|
792
793
|
<Button
|
|
@@ -894,7 +895,7 @@
|
|
|
894
895
|
<FileText class="h-4 w-4" />
|
|
895
896
|
{/if}
|
|
896
897
|
</div>
|
|
897
|
-
<span class="text-sm">{docType.title}
|
|
898
|
+
<span class="text-sm">{pluralize(docType.title)}</span>
|
|
898
899
|
</div>
|
|
899
900
|
<svg
|
|
900
901
|
class="text-muted-foreground h-4 w-4 opacity-0 transition-opacity group-hover:opacity-100"
|
|
@@ -953,8 +954,8 @@
|
|
|
953
954
|
>
|
|
954
955
|
<div class="flex flex-1 items-start justify-center p-2 pt-8 text-left">
|
|
955
956
|
<div class="text-foreground rotate-90 transform text-sm font-medium">
|
|
956
|
-
{(documentTypes.find((t) => t.name === selectedDocumentType)?.title ||
|
|
957
|
-
selectedDocumentType)
|
|
957
|
+
{pluralize(documentTypes.find((t) => t.name === selectedDocumentType)?.title ||
|
|
958
|
+
selectedDocumentType)}
|
|
958
959
|
</div>
|
|
959
960
|
</div>
|
|
960
961
|
</button>
|
|
@@ -978,7 +979,7 @@
|
|
|
978
979
|
{/if}
|
|
979
980
|
<div>
|
|
980
981
|
<h3 class="text-sm font-medium">
|
|
981
|
-
{(currentDocType?.title || selectedDocumentType)
|
|
982
|
+
{pluralize(currentDocType?.title || selectedDocumentType)}
|
|
982
983
|
</h3>
|
|
983
984
|
<p class="text-muted-foreground text-xs">
|
|
984
985
|
{docTotalDocs} document{docTotalDocs !== 1 ? 's' : ''}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminApp.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/components/AdminApp.svelte.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"AdminApp.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/components/AdminApp.svelte.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAuBnE,UAAU,KAAK;IACd,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,aAAa,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5E,WAAW,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IACvE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE;QAAE,KAAK,EAAE,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAA;KAAE,CAAC;IACxD,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,eAAe,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAC;CAChD;AAouCF,QAAA,MAAM,QAAQ,2CAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
|
|
@@ -6,9 +6,9 @@ interface Props {
|
|
|
6
6
|
children?: any;
|
|
7
7
|
}
|
|
8
8
|
declare const AdminLayout: import("svelte").Component<Props, {
|
|
9
|
-
typesPanel: "w-full" | "flex-1" | "
|
|
10
|
-
documentsPanel: "w-full" | "flex-1" | "
|
|
11
|
-
editorPanel: "w-full" | "flex-1"
|
|
9
|
+
typesPanel: "hidden" | "w-full" | "flex-1" | "w-[350px]" | "w-[60px]";
|
|
10
|
+
documentsPanel: "hidden" | "w-full" | "flex-1" | "w-[350px]" | "w-[60px]";
|
|
11
|
+
editorPanel: "hidden" | "w-full" | "flex-1";
|
|
12
12
|
}, "">;
|
|
13
13
|
type AdminLayout = ReturnType<typeof AdminLayout>;
|
|
14
14
|
export default AdminLayout;
|
|
@@ -673,7 +673,7 @@
|
|
|
673
673
|
}
|
|
674
674
|
</script>
|
|
675
675
|
|
|
676
|
-
<div class="relative flex h-full flex-col">
|
|
676
|
+
<div class="relative flex h-full flex-col overflow-hidden">
|
|
677
677
|
<!-- Header Toolbar (Sanity-style) -->
|
|
678
678
|
<div class="border-border bg-background flex h-14 items-center justify-between border-b px-4">
|
|
679
679
|
<!-- Left side: Document info and status -->
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import { documents } from '../../../api/documents';
|
|
13
13
|
import { toast } from 'svelte-sonner';
|
|
14
14
|
import { cmsLogger } from '../../../utils/logger';
|
|
15
|
+
import { pluralize } from '../../../utils/pluralize';
|
|
15
16
|
|
|
16
17
|
interface Props {
|
|
17
18
|
field: Field;
|
|
@@ -213,7 +214,7 @@
|
|
|
213
214
|
<Command.Empty>
|
|
214
215
|
<div class="flex flex-col items-center gap-2 py-4">
|
|
215
216
|
<p class="text-muted-foreground text-sm">
|
|
216
|
-
No {targetType}
|
|
217
|
+
No {pluralize(targetType)} found
|
|
217
218
|
</p>
|
|
218
219
|
<Button size="sm" onclick={createNewDocument} disabled={creating} class="gap-1">
|
|
219
220
|
<PlusIcon class="h-3 w-3" />
|
|
@@ -253,7 +254,7 @@
|
|
|
253
254
|
</Command.Group>
|
|
254
255
|
{:else}
|
|
255
256
|
<Command.Empty>
|
|
256
|
-
No {targetType}
|
|
257
|
+
No {pluralize(targetType)} available
|
|
257
258
|
</Command.Empty>
|
|
258
259
|
{/if}
|
|
259
260
|
</Command.List>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReferenceField.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/admin/fields/ReferenceField.svelte.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,KAAK,EAAwC,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"ReferenceField.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/admin/fields/ReferenceField.svelte.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,KAAK,EAAwC,MAAM,wBAAwB,CAAC;AAOzF,UAAU,KAAK;IACd,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACzC,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAyOF,QAAA,MAAM,cAAc,2CAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { Sidebar } from '@aphexcms/ui/shadcn/sidebar';
|
|
2
|
+
import type { SidebarData } from '../../../types/sidebar.js';
|
|
3
|
+
import type { ComponentProps } from 'svelte';
|
|
4
|
+
type Props = ComponentProps<typeof Sidebar> & {
|
|
5
|
+
data: SidebarData;
|
|
6
|
+
onSignOut?: () => void | Promise<void>;
|
|
7
|
+
};
|
|
8
|
+
declare const AppSidebar: import("svelte").Component<Props, {}, "">;
|
|
2
9
|
type AppSidebar = ReturnType<typeof AppSidebar>;
|
|
3
10
|
export default AppSidebar;
|
|
4
11
|
//# sourceMappingURL=AppSidebar.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppSidebar.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/sidebar/AppSidebar.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppSidebar.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/sidebar/AppSidebar.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,OAAO,EAKP,MAAM,6BAA6B,CAAC;AAItC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAG5C,KAAK,KAAK,GAAG,cAAc,CAAC,OAAO,OAAO,CAAC,GAAG;IAC7C,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC,CAAC;AAqDH,QAAA,MAAM,UAAU,2CAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluralize.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/pluralize.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAY9C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple English pluralization.
|
|
3
|
+
* Handles common patterns: y→ies, s/sh/ch/x/z→es, otherwise appends s.
|
|
4
|
+
*/
|
|
5
|
+
export function pluralize(word) {
|
|
6
|
+
if (!word)
|
|
7
|
+
return word;
|
|
8
|
+
if (/[sxz]$/i.test(word) || /[sc]h$/i.test(word)) {
|
|
9
|
+
return word + 'es';
|
|
10
|
+
}
|
|
11
|
+
if (/[^aeiou]y$/i.test(word)) {
|
|
12
|
+
return word.slice(0, -1) + 'ies';
|
|
13
|
+
}
|
|
14
|
+
return word + 's';
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=pluralize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluralize.js","sourceRoot":"","sources":["../../../src/lib/utils/pluralize.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IACrC,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAEvB,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,OAAO,IAAI,GAAG,IAAI,CAAC;IACpB,CAAC;IAED,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;IAClC,CAAC;IAED,OAAO,IAAI,GAAG,GAAG,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluralize.d.ts","sourceRoot":"","sources":["../../src/lib/utils/pluralize.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAY9C"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple English pluralization.
|
|
3
|
+
* Handles common patterns: y→ies, s/sh/ch/x/z→es, otherwise appends s.
|
|
4
|
+
*/
|
|
5
|
+
export function pluralize(word) {
|
|
6
|
+
if (!word)
|
|
7
|
+
return word;
|
|
8
|
+
if (/[sxz]$/i.test(word) || /[sc]h$/i.test(word)) {
|
|
9
|
+
return word + 'es';
|
|
10
|
+
}
|
|
11
|
+
if (/[^aeiou]y$/i.test(word)) {
|
|
12
|
+
return word.slice(0, -1) + 'ies';
|
|
13
|
+
}
|
|
14
|
+
return word + 's';
|
|
15
|
+
}
|