nextjs-cms 0.7.7 → 0.7.8
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/api/index.d.ts +32 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/root.d.ts +64 -0
- package/dist/api/root.d.ts.map +1 -1
- package/dist/api/root.js +2 -0
- package/dist/api/routers/fields.d.ts +34 -0
- package/dist/api/routers/fields.d.ts.map +1 -0
- package/dist/api/routers/fields.js +48 -0
- package/dist/core/fields/select.d.ts +1 -1
- package/dist/core/fields/tags.d.ts +44 -30
- package/dist/core/fields/tags.d.ts.map +1 -1
- package/dist/core/fields/tags.js +38 -17
- package/dist/core/sections/category.d.ts +2 -2
- package/dist/core/sections/hasItems.d.ts +2 -2
- package/dist/core/sections/section.d.ts +1 -1
- package/dist/core/sections/simple.d.ts +2 -2
- package/dist/translations/base/en.d.ts +1 -0
- package/dist/translations/base/en.d.ts.map +1 -1
- package/dist/translations/base/en.js +1 -0
- package/dist/translations/client.d.ts +16 -4
- package/dist/translations/client.d.ts.map +1 -1
- package/dist/translations/server.d.ts +16 -4
- package/dist/translations/server.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/api/index.d.ts
CHANGED
|
@@ -762,6 +762,38 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
762
762
|
meta: object;
|
|
763
763
|
}>;
|
|
764
764
|
}>>;
|
|
765
|
+
fields: import("@trpc/server").TRPCBuiltRouter<{
|
|
766
|
+
ctx: {
|
|
767
|
+
headers: Headers;
|
|
768
|
+
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
769
|
+
$client: import("mysql2/promise").Pool;
|
|
770
|
+
};
|
|
771
|
+
session: import("../index.js").Session | null;
|
|
772
|
+
};
|
|
773
|
+
meta: object;
|
|
774
|
+
errorShape: {
|
|
775
|
+
data: {
|
|
776
|
+
zodError: import("zod").ZodFlattenedError<unknown, string> | null;
|
|
777
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
778
|
+
httpStatus: number;
|
|
779
|
+
path?: string;
|
|
780
|
+
stack?: string;
|
|
781
|
+
};
|
|
782
|
+
message: string;
|
|
783
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
784
|
+
};
|
|
785
|
+
transformer: true;
|
|
786
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
787
|
+
tagsAutoComplete: import("@trpc/server").TRPCQueryProcedure<{
|
|
788
|
+
input: {
|
|
789
|
+
sectionName: string;
|
|
790
|
+
fieldName: string;
|
|
791
|
+
query: string;
|
|
792
|
+
};
|
|
793
|
+
output: string[];
|
|
794
|
+
meta: object;
|
|
795
|
+
}>;
|
|
796
|
+
}>>;
|
|
765
797
|
logs: import("@trpc/server").TRPCBuiltRouter<{
|
|
766
798
|
ctx: {
|
|
767
799
|
headers: Headers;
|
package/dist/api/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAEzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC5E,OAAO,EAEH,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,MAAM,EACN,eAAe,EAClB,MAAM,WAAW,CAAA;AAElB;;;;;;GAMG;AACH,QAAA,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAEzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAiC,CAAA;AAEnD;;;;;IAKI;AACJ,KAAK,YAAY,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAA;AAEhD;;;;;IAKI;AACJ,KAAK,aAAa,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAA;AAElD,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAE,uBAAuB,EAAE,YAAY,EAAE,CAAA;AAC5F,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAA;AACrE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA"}
|
package/dist/api/root.d.ts
CHANGED
|
@@ -753,6 +753,38 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
753
753
|
meta: object;
|
|
754
754
|
}>;
|
|
755
755
|
}>>;
|
|
756
|
+
fields: import("@trpc/server").TRPCBuiltRouter<{
|
|
757
|
+
ctx: {
|
|
758
|
+
headers: Headers;
|
|
759
|
+
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
760
|
+
$client: import("mysql2/promise").Pool;
|
|
761
|
+
};
|
|
762
|
+
session: import("../index.js").Session | null;
|
|
763
|
+
};
|
|
764
|
+
meta: object;
|
|
765
|
+
errorShape: {
|
|
766
|
+
data: {
|
|
767
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
768
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
769
|
+
httpStatus: number;
|
|
770
|
+
path?: string;
|
|
771
|
+
stack?: string;
|
|
772
|
+
};
|
|
773
|
+
message: string;
|
|
774
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
775
|
+
};
|
|
776
|
+
transformer: true;
|
|
777
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
778
|
+
tagsAutoComplete: import("@trpc/server").TRPCQueryProcedure<{
|
|
779
|
+
input: {
|
|
780
|
+
sectionName: string;
|
|
781
|
+
fieldName: string;
|
|
782
|
+
query: string;
|
|
783
|
+
};
|
|
784
|
+
output: string[];
|
|
785
|
+
meta: object;
|
|
786
|
+
}>;
|
|
787
|
+
}>>;
|
|
756
788
|
logs: import("@trpc/server").TRPCBuiltRouter<{
|
|
757
789
|
ctx: {
|
|
758
790
|
headers: Headers;
|
|
@@ -1618,6 +1650,38 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
1618
1650
|
meta: object;
|
|
1619
1651
|
}>;
|
|
1620
1652
|
}>>;
|
|
1653
|
+
fields: import("@trpc/server").TRPCBuiltRouter<{
|
|
1654
|
+
ctx: {
|
|
1655
|
+
headers: Headers;
|
|
1656
|
+
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
1657
|
+
$client: import("mysql2/promise").Pool;
|
|
1658
|
+
};
|
|
1659
|
+
session: import("../index.js").Session | null;
|
|
1660
|
+
};
|
|
1661
|
+
meta: object;
|
|
1662
|
+
errorShape: {
|
|
1663
|
+
data: {
|
|
1664
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
1665
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1666
|
+
httpStatus: number;
|
|
1667
|
+
path?: string;
|
|
1668
|
+
stack?: string;
|
|
1669
|
+
};
|
|
1670
|
+
message: string;
|
|
1671
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
1672
|
+
};
|
|
1673
|
+
transformer: true;
|
|
1674
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
1675
|
+
tagsAutoComplete: import("@trpc/server").TRPCQueryProcedure<{
|
|
1676
|
+
input: {
|
|
1677
|
+
sectionName: string;
|
|
1678
|
+
fieldName: string;
|
|
1679
|
+
query: string;
|
|
1680
|
+
};
|
|
1681
|
+
output: string[];
|
|
1682
|
+
meta: object;
|
|
1683
|
+
}>;
|
|
1684
|
+
}>>;
|
|
1621
1685
|
logs: import("@trpc/server").TRPCBuiltRouter<{
|
|
1622
1686
|
ctx: {
|
|
1623
1687
|
headers: Headers;
|
package/dist/api/root.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/api/root.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/api/root.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAgB5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA8FvB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAiC,CAAA"}
|
package/dist/api/root.js
CHANGED
|
@@ -10,6 +10,7 @@ import { categorySectionRouter } from './routers/categorySection.js';
|
|
|
10
10
|
import { accountSettings } from './routers/accountSettings.js';
|
|
11
11
|
import { galleryRouter } from './routers/gallery.js';
|
|
12
12
|
import { logsRouter } from './routers/logs.js';
|
|
13
|
+
import { fieldsRouter } from './routers/fields.js';
|
|
13
14
|
import { getConfigImportVersion } from '../core/config/index.js';
|
|
14
15
|
import { getPluginRoutes, loadPlugins } from '../plugins/loader.js';
|
|
15
16
|
import { z } from 'zod';
|
|
@@ -50,6 +51,7 @@ const coreRouters = {
|
|
|
50
51
|
gallery: galleryRouter,
|
|
51
52
|
navigation: navRouter,
|
|
52
53
|
accountSettings: accountSettings,
|
|
54
|
+
fields: fieldsRouter,
|
|
53
55
|
logs: logsRouter,
|
|
54
56
|
plugins: pluginsRouter,
|
|
55
57
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
export declare const fieldsRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
3
|
+
ctx: {
|
|
4
|
+
headers: Headers;
|
|
5
|
+
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../../db/schema.js")> & {
|
|
6
|
+
$client: import("mysql2/promise").Pool;
|
|
7
|
+
};
|
|
8
|
+
session: import("../../index.js").Session | null;
|
|
9
|
+
};
|
|
10
|
+
meta: object;
|
|
11
|
+
errorShape: {
|
|
12
|
+
data: {
|
|
13
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
14
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
15
|
+
httpStatus: number;
|
|
16
|
+
path?: string;
|
|
17
|
+
stack?: string;
|
|
18
|
+
};
|
|
19
|
+
message: string;
|
|
20
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
21
|
+
};
|
|
22
|
+
transformer: true;
|
|
23
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
24
|
+
tagsAutoComplete: import("@trpc/server").TRPCQueryProcedure<{
|
|
25
|
+
input: {
|
|
26
|
+
sectionName: string;
|
|
27
|
+
fieldName: string;
|
|
28
|
+
query: string;
|
|
29
|
+
};
|
|
30
|
+
output: string[];
|
|
31
|
+
meta: object;
|
|
32
|
+
}>;
|
|
33
|
+
}>>;
|
|
34
|
+
//# sourceMappingURL=fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../../src/api/routers/fields.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AASxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDvB,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { privateProcedure, router } from '../trpc.js';
|
|
2
|
+
import * as z from 'zod';
|
|
3
|
+
import { SectionFactory } from '../../core/factories/index.js';
|
|
4
|
+
import { TRPCError } from '@trpc/server';
|
|
5
|
+
import getString from '../../translations/index.js';
|
|
6
|
+
import { db } from '../../db/client.js';
|
|
7
|
+
import { sql } from 'drizzle-orm';
|
|
8
|
+
import { is } from '../../core/helpers/index.js';
|
|
9
|
+
import { TagsField } from '../../core/fields/index.js';
|
|
10
|
+
export const fieldsRouter = router({
|
|
11
|
+
tagsAutoComplete: privateProcedure
|
|
12
|
+
.input(z.object({
|
|
13
|
+
sectionName: z.string(),
|
|
14
|
+
fieldName: z.string(),
|
|
15
|
+
query: z.string().max(100),
|
|
16
|
+
}))
|
|
17
|
+
.query(async ({ ctx, input }) => {
|
|
18
|
+
const sectionConfig = await SectionFactory.getSectionForAdmin({
|
|
19
|
+
name: input.sectionName,
|
|
20
|
+
admin: {
|
|
21
|
+
id: ctx.session.user.id,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
if (!sectionConfig?.name) {
|
|
25
|
+
throw new TRPCError({
|
|
26
|
+
code: 'NOT_FOUND',
|
|
27
|
+
message: getString('sectionNotFound', ctx.session.user.locale),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
const section = sectionConfig.build();
|
|
31
|
+
section.buildFields();
|
|
32
|
+
const field = section.fields.find((f) => f.name === input.fieldName);
|
|
33
|
+
if (!field || !is(field, TagsField) || !field.autoCompletion || !field.destinationDb) {
|
|
34
|
+
throw new TRPCError({
|
|
35
|
+
code: 'BAD_REQUEST',
|
|
36
|
+
message: `Field "${input.fieldName}" does not support auto-completion`,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
const { table, selectIdentifier } = field.destinationDb;
|
|
40
|
+
const searchPattern = `%${input.query}%`;
|
|
41
|
+
const [rows] = await db.execute(sql `SELECT DISTINCT \`${sql.raw(selectIdentifier)}\` as value
|
|
42
|
+
FROM \`${sql.raw(table)}\`
|
|
43
|
+
WHERE \`${sql.raw(selectIdentifier)}\` LIKE ${searchPattern}
|
|
44
|
+
ORDER BY \`${sql.raw(selectIdentifier)}\` ASC
|
|
45
|
+
LIMIT 20`);
|
|
46
|
+
return rows.map((row) => row.value);
|
|
47
|
+
}),
|
|
48
|
+
});
|
|
@@ -346,8 +346,8 @@ declare const selectFieldConfigSchema: z.ZodIntersection<z.ZodUnion<readonly [z.
|
|
|
346
346
|
}, z.core.$strict>]>, z.ZodObject<{
|
|
347
347
|
type: z.ZodLiteral<"select">;
|
|
348
348
|
optionsType: z.ZodEnum<{
|
|
349
|
-
db: "db";
|
|
350
349
|
section: "section";
|
|
350
|
+
db: "db";
|
|
351
351
|
static: "static";
|
|
352
352
|
}>;
|
|
353
353
|
build: z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodCustom<SelectField, SelectField>>;
|
|
@@ -2,6 +2,11 @@ import type { BaseFieldConfig } from './field.js';
|
|
|
2
2
|
import { Field } from './field.js';
|
|
3
3
|
import { entityKind } from '../helpers/index.js';
|
|
4
4
|
import * as z from 'zod';
|
|
5
|
+
declare const destinationDbSchema: z.ZodObject<{
|
|
6
|
+
table: z.ZodString;
|
|
7
|
+
itemIdentifier: z.ZodString;
|
|
8
|
+
selectIdentifier: z.ZodString;
|
|
9
|
+
}, z.core.$strict>;
|
|
5
10
|
declare const configSchema: z.ZodObject<{
|
|
6
11
|
/**
|
|
7
12
|
* A destination table where the values will be saved
|
|
@@ -12,10 +17,12 @@ declare const configSchema: z.ZodObject<{
|
|
|
12
17
|
itemIdentifier: z.ZodString;
|
|
13
18
|
selectIdentifier: z.ZodString;
|
|
14
19
|
}, z.core.$strict>>;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Enable auto-completion for this tags field.
|
|
22
|
+
* When true, the admin UI will show suggestions from existing values in the destinationDb table.
|
|
23
|
+
* Requires destinationDb to be set — enforced by TypeScript and at runtime.
|
|
24
|
+
*/
|
|
25
|
+
autoCompletion: z.ZodOptional<z.ZodBoolean>;
|
|
19
26
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
20
27
|
/**
|
|
21
28
|
* Whether to sanitize the value before saving it to the database.
|
|
@@ -33,6 +40,7 @@ export declare class TagsField extends Field<'tags', Config> {
|
|
|
33
40
|
itemIdentifier: string;
|
|
34
41
|
selectIdentifier: string;
|
|
35
42
|
};
|
|
43
|
+
readonly autoCompletion: boolean;
|
|
36
44
|
readonly placeholder: string;
|
|
37
45
|
readonly sanitize: boolean;
|
|
38
46
|
private _itemIdentifier;
|
|
@@ -50,6 +58,7 @@ export declare class TagsField extends Field<'tags', Config> {
|
|
|
50
58
|
exportForClient(): {
|
|
51
59
|
placeholder: string;
|
|
52
60
|
sanitize: boolean;
|
|
61
|
+
hasAutoCompletion: boolean;
|
|
53
62
|
type: "tags";
|
|
54
63
|
name: string;
|
|
55
64
|
label: import("../../index.js").LocalizedString;
|
|
@@ -82,33 +91,19 @@ export declare class TagsField extends Field<'tags', Config> {
|
|
|
82
91
|
* @private
|
|
83
92
|
*/
|
|
84
93
|
private checkDestinationDBTableAndColumns;
|
|
94
|
+
/**
|
|
95
|
+
* Ensure autoCompletion is only used when destinationDb is set
|
|
96
|
+
* @private
|
|
97
|
+
*/
|
|
98
|
+
private checkAutoCompletionRequiresDestinationDb;
|
|
85
99
|
/**
|
|
86
100
|
* Prepare and build the field for submission
|
|
87
101
|
*/
|
|
88
102
|
prepareForSubmission(): Promise<void>;
|
|
89
103
|
}
|
|
90
104
|
export type TagsFieldClientConfig = ReturnType<TagsField['exportForClient']>;
|
|
91
|
-
declare const
|
|
92
|
-
/**
|
|
93
|
-
* A destination table where the values will be saved
|
|
94
|
-
* When this is set, the value of the field will only be saved in the destination table as one row per each value
|
|
95
|
-
*/
|
|
96
|
-
destinationDb: z.ZodOptional<z.ZodObject<{
|
|
97
|
-
table: z.ZodString;
|
|
98
|
-
itemIdentifier: z.ZodString;
|
|
99
|
-
selectIdentifier: z.ZodString;
|
|
100
|
-
}, z.core.$strict>>;
|
|
101
|
-
autoCompletion: z.ZodOptional<z.ZodObject<{
|
|
102
|
-
table: z.ZodString;
|
|
103
|
-
column: z.ZodString;
|
|
104
|
-
}, z.core.$strict>>;
|
|
105
|
+
declare const baseOptionsSchema: z.ZodObject<{
|
|
105
106
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
106
|
-
/**
|
|
107
|
-
* Whether to sanitize the value before saving it to the database.
|
|
108
|
-
* If true, the value will be escaped to prevent XSS attacks.
|
|
109
|
-
* If false, the value will be saved as is (raw input).
|
|
110
|
-
* @default false
|
|
111
|
-
*/
|
|
112
107
|
sanitize: z.ZodOptional<z.ZodBoolean>;
|
|
113
108
|
name: z.ZodString;
|
|
114
109
|
label: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
@@ -118,6 +113,21 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
118
113
|
conditionalRules: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").ConditionalRule, import("../types/index.js").ConditionalRule>>>;
|
|
119
114
|
adminGenerated: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodLiteral<false>, z.ZodLiteral<"readonly">]>>;
|
|
120
115
|
}, z.core.$strict>;
|
|
116
|
+
type BaseOptions = z.infer<typeof baseOptionsSchema>;
|
|
117
|
+
type DestinationDb = z.infer<typeof destinationDbSchema>;
|
|
118
|
+
/**
|
|
119
|
+
* TypeScript-enforced discriminated union:
|
|
120
|
+
* autoCompletion is only allowed when destinationDb is present
|
|
121
|
+
*/
|
|
122
|
+
type TagsFieldWithDestinationDb = BaseOptions & {
|
|
123
|
+
destinationDb: DestinationDb;
|
|
124
|
+
autoCompletion?: boolean;
|
|
125
|
+
};
|
|
126
|
+
type TagsFieldWithoutDestinationDb = BaseOptions & {
|
|
127
|
+
destinationDb?: undefined;
|
|
128
|
+
autoCompletion?: never;
|
|
129
|
+
};
|
|
130
|
+
type TagsFieldOptions = TagsFieldWithDestinationDb | TagsFieldWithoutDestinationDb;
|
|
121
131
|
declare const tagsFieldConfigSchema: z.ZodObject<{
|
|
122
132
|
type: z.ZodLiteral<"tags">;
|
|
123
133
|
build: z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodCustom<TagsField, TagsField>>;
|
|
@@ -130,10 +140,12 @@ declare const tagsFieldConfigSchema: z.ZodObject<{
|
|
|
130
140
|
itemIdentifier: z.ZodString;
|
|
131
141
|
selectIdentifier: z.ZodString;
|
|
132
142
|
}, z.core.$strict>>;
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
143
|
+
/**
|
|
144
|
+
* Enable auto-completion for this tags field.
|
|
145
|
+
* When true, the admin UI will show suggestions from existing values in the destinationDb table.
|
|
146
|
+
* Requires destinationDb to be set — enforced by TypeScript and at runtime.
|
|
147
|
+
*/
|
|
148
|
+
autoCompletion: z.ZodOptional<z.ZodBoolean>;
|
|
137
149
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
138
150
|
/**
|
|
139
151
|
* Whether to sanitize the value before saving it to the database.
|
|
@@ -159,8 +171,10 @@ export type TagsFieldConfig = z.infer<typeof tagsFieldConfigSchema>;
|
|
|
159
171
|
/**
|
|
160
172
|
* Helper function to create a tags field configuration
|
|
161
173
|
* Returns a config object with a build() method that can be serialized and used anywhere
|
|
162
|
-
*
|
|
174
|
+
*
|
|
175
|
+
* autoCompletion is only available when destinationDb is set (enforced by TypeScript).
|
|
176
|
+
* When enabled, the admin UI will suggest existing tag values from the destinationDb table.
|
|
163
177
|
*/
|
|
164
|
-
export declare function tagsField(field:
|
|
178
|
+
export declare function tagsField(field: TagsFieldOptions): TagsFieldConfig;
|
|
165
179
|
export {};
|
|
166
180
|
//# sourceMappingURL=tags.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../../../src/core/fields/tags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EAAE,KAAK,EAAyB,MAAM,YAAY,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAKhD,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAGxB,QAAA,MAAM,YAAY;IACd;;;OAGG
|
|
1
|
+
{"version":3,"file":"tags.d.ts","sourceRoot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import * as z from 'zod';
|
|
7
7
|
import { escapeHTML } from '../security/dom.js';
|
|
8
|
+
const destinationDbSchema = z.strictObject({
|
|
9
|
+
table: z.string().describe('The destination table name'),
|
|
10
|
+
itemIdentifier: z.string().describe('The identifier of the item that has this tags field as a field'),
|
|
11
|
+
selectIdentifier: z.string().describe('An identifier name for the value of the values in the tags field'),
|
|
12
|
+
});
|
|
8
13
|
const configSchema = z.strictObject({
|
|
9
14
|
/**
|
|
10
15
|
* A destination table where the values will be saved
|
|
11
16
|
* When this is set, the value of the field will only be saved in the destination table as one row per each value
|
|
12
17
|
*/
|
|
13
|
-
destinationDb:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
.describe('Destination table configuration'),
|
|
21
|
-
autoCompletion: z
|
|
22
|
-
.strictObject({
|
|
23
|
-
table: z.string().describe('The table where the auto completion values are stored'),
|
|
24
|
-
column: z.string().describe('The column where the values are stored'),
|
|
25
|
-
})
|
|
26
|
-
.optional()
|
|
27
|
-
.describe('Auto completion configuration'),
|
|
18
|
+
destinationDb: destinationDbSchema.optional().describe('Destination table configuration'),
|
|
19
|
+
/**
|
|
20
|
+
* Enable auto-completion for this tags field.
|
|
21
|
+
* When true, the admin UI will show suggestions from existing values in the destinationDb table.
|
|
22
|
+
* Requires destinationDb to be set — enforced by TypeScript and at runtime.
|
|
23
|
+
*/
|
|
24
|
+
autoCompletion: z.boolean().optional().describe('Enable auto completion from destinationDb values'),
|
|
28
25
|
placeholder: z.string().optional().describe('The placeholder text for the field'),
|
|
29
26
|
/**
|
|
30
27
|
* Whether to sanitize the value before saving it to the database.
|
|
@@ -37,6 +34,7 @@ const configSchema = z.strictObject({
|
|
|
37
34
|
export class TagsField extends Field {
|
|
38
35
|
static [entityKind] = 'TagsField';
|
|
39
36
|
destinationDb;
|
|
37
|
+
autoCompletion;
|
|
40
38
|
placeholder;
|
|
41
39
|
sanitize;
|
|
42
40
|
_itemIdentifier;
|
|
@@ -44,6 +42,7 @@ export class TagsField extends Field {
|
|
|
44
42
|
constructor(config) {
|
|
45
43
|
super(config, 'tags');
|
|
46
44
|
this.destinationDb = config.destinationDb;
|
|
45
|
+
this.autoCompletion = config.autoCompletion ?? false;
|
|
47
46
|
this.placeholder = config.placeholder || 'Hit enter or comma to add a tag...';
|
|
48
47
|
this.sanitize = config.sanitize ?? false;
|
|
49
48
|
}
|
|
@@ -69,6 +68,7 @@ export class TagsField extends Field {
|
|
|
69
68
|
...super.exportForClient(),
|
|
70
69
|
placeholder: this.placeholder,
|
|
71
70
|
sanitize: this.sanitize,
|
|
71
|
+
hasAutoCompletion: this.autoCompletion,
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
checkRequired() {
|
|
@@ -80,6 +80,9 @@ export class TagsField extends Field {
|
|
|
80
80
|
* Build the field to be rendered in a form
|
|
81
81
|
*/
|
|
82
82
|
async build() {
|
|
83
|
+
if (this.autoCompletion) {
|
|
84
|
+
this.checkAutoCompletionRequiresDestinationDb();
|
|
85
|
+
}
|
|
83
86
|
if (this.destinationDb) {
|
|
84
87
|
this.checkDestinationDBConfig();
|
|
85
88
|
await this.checkDestinationDBTableAndColumns();
|
|
@@ -176,10 +179,22 @@ export class TagsField extends Field {
|
|
|
176
179
|
throw new Error(`Field ${this.label}: Table ${this.destinationDb.table} and/or columns: ${this.destinationDb.selectIdentifier}, ${this.destinationDb.itemIdentifier} do not exist in the database!, did you forget to run update-sections?`);
|
|
177
180
|
}
|
|
178
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* Ensure autoCompletion is only used when destinationDb is set
|
|
184
|
+
* @private
|
|
185
|
+
*/
|
|
186
|
+
checkAutoCompletionRequiresDestinationDb() {
|
|
187
|
+
if (this.autoCompletion && !this.destinationDb) {
|
|
188
|
+
throw new Error(`Field ${this.label}: autoCompletion requires destinationDb to be set. Without destinationDb, tags are stored as a comma-separated string and there is no dedicated table to query for suggestions.`);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
179
191
|
/**
|
|
180
192
|
* Prepare and build the field for submission
|
|
181
193
|
*/
|
|
182
194
|
async prepareForSubmission() {
|
|
195
|
+
if (this.autoCompletion) {
|
|
196
|
+
this.checkAutoCompletionRequiresDestinationDb();
|
|
197
|
+
}
|
|
183
198
|
if (this.destinationDb) {
|
|
184
199
|
this.checkDestinationDBConfig();
|
|
185
200
|
await this.checkDestinationDBTableAndColumns();
|
|
@@ -199,6 +214,11 @@ export class TagsField extends Field {
|
|
|
199
214
|
}
|
|
200
215
|
}
|
|
201
216
|
}
|
|
217
|
+
const baseOptionsSchema = z.strictObject({
|
|
218
|
+
...baseFieldConfigSchema.shape,
|
|
219
|
+
placeholder: configSchema.shape.placeholder,
|
|
220
|
+
sanitize: configSchema.shape.sanitize,
|
|
221
|
+
});
|
|
202
222
|
const optionsSchema = z.strictObject({
|
|
203
223
|
...baseFieldConfigSchema.shape,
|
|
204
224
|
...configSchema.shape,
|
|
@@ -211,7 +231,9 @@ const tagsFieldConfigSchema = z.strictObject({
|
|
|
211
231
|
/**
|
|
212
232
|
* Helper function to create a tags field configuration
|
|
213
233
|
* Returns a config object with a build() method that can be serialized and used anywhere
|
|
214
|
-
*
|
|
234
|
+
*
|
|
235
|
+
* autoCompletion is only available when destinationDb is set (enforced by TypeScript).
|
|
236
|
+
* When enabled, the admin UI will suggest existing tag values from the destinationDb table.
|
|
215
237
|
*/
|
|
216
238
|
export function tagsField(field) {
|
|
217
239
|
/**
|
|
@@ -225,7 +247,6 @@ export function tagsField(field) {
|
|
|
225
247
|
...field,
|
|
226
248
|
type: 'tags',
|
|
227
249
|
build() {
|
|
228
|
-
// Use the original field config directly (it doesn't have build() method)
|
|
229
250
|
return new TagsField(field);
|
|
230
251
|
},
|
|
231
252
|
};
|
|
@@ -118,8 +118,8 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
118
118
|
*/
|
|
119
119
|
allowRecursiveDelete: z.ZodOptional<z.ZodBoolean>;
|
|
120
120
|
fields: z.ZodUnion<[z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>, z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>]>;
|
|
121
|
-
name: z.ZodString;
|
|
122
121
|
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
122
|
+
name: z.ZodString;
|
|
123
123
|
order: z.ZodNumber;
|
|
124
124
|
db: z.ZodObject<{
|
|
125
125
|
table: z.ZodString;
|
|
@@ -218,8 +218,8 @@ export declare const categorySectionConfigSchema: z.ZodObject<{
|
|
|
218
218
|
* @default false
|
|
219
219
|
*/
|
|
220
220
|
allowRecursiveDelete: z.ZodOptional<z.ZodBoolean>;
|
|
221
|
-
name: z.ZodString;
|
|
222
221
|
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
222
|
+
name: z.ZodString;
|
|
223
223
|
order: z.ZodNumber;
|
|
224
224
|
db: z.ZodObject<{
|
|
225
225
|
table: z.ZodString;
|
|
@@ -481,8 +481,8 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
481
481
|
}>>;
|
|
482
482
|
generateQR: z.ZodOptional<z.ZodBoolean>;
|
|
483
483
|
fields: z.ZodUnion<[z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>, z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>]>;
|
|
484
|
-
name: z.ZodString;
|
|
485
484
|
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
485
|
+
name: z.ZodString;
|
|
486
486
|
order: z.ZodNumber;
|
|
487
487
|
db: z.ZodObject<{
|
|
488
488
|
table: z.ZodString;
|
|
@@ -757,8 +757,8 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
|
|
|
757
757
|
adminGenerated?: boolean | "readonly" | undefined;
|
|
758
758
|
}>>;
|
|
759
759
|
generateQR: z.ZodOptional<z.ZodBoolean>;
|
|
760
|
-
name: z.ZodString;
|
|
761
760
|
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
761
|
+
name: z.ZodString;
|
|
762
762
|
order: z.ZodNumber;
|
|
763
763
|
db: z.ZodObject<{
|
|
764
764
|
table: z.ZodString;
|
|
@@ -65,8 +65,8 @@ export declare const baseSectionOptionsSchema: z.ZodObject<{
|
|
|
65
65
|
*/
|
|
66
66
|
export declare const baseHelperFunctionOptionsSchema: z.ZodObject<{
|
|
67
67
|
fields: z.ZodUnion<[z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>, z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>]>;
|
|
68
|
-
name: z.ZodString;
|
|
69
68
|
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
69
|
+
name: z.ZodString;
|
|
70
70
|
order: z.ZodNumber;
|
|
71
71
|
db: z.ZodObject<{
|
|
72
72
|
table: z.ZodString;
|
|
@@ -23,8 +23,8 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
23
23
|
table: z.ZodString;
|
|
24
24
|
}, z.core.$strict>;
|
|
25
25
|
fields: z.ZodUnion<[z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>, z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>]>;
|
|
26
|
-
name: z.ZodString;
|
|
27
26
|
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
27
|
+
name: z.ZodString;
|
|
28
28
|
order: z.ZodNumber;
|
|
29
29
|
icon: z.ZodOptional<z.ZodString>;
|
|
30
30
|
gallery: z.ZodOptional<z.ZodObject<{
|
|
@@ -57,8 +57,8 @@ declare const simpleSectionConfigSchema: z.ZodObject<{
|
|
|
57
57
|
db: z.ZodObject<{
|
|
58
58
|
table: z.ZodString;
|
|
59
59
|
}, z.core.$strict>;
|
|
60
|
-
name: z.ZodString;
|
|
61
60
|
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
61
|
+
name: z.ZodString;
|
|
62
62
|
order: z.ZodNumber;
|
|
63
63
|
icon: z.ZodOptional<z.ZodString>;
|
|
64
64
|
gallery: z.ZodOptional<z.ZodObject<{
|
|
@@ -183,6 +183,7 @@ declare const _default: {
|
|
|
183
183
|
readonly browse: "Browse";
|
|
184
184
|
readonly noFileSelected: "No file selected";
|
|
185
185
|
readonly startTyping: "Start typing";
|
|
186
|
+
readonly startTypingForSuggestions: "Start typing for suggestions...";
|
|
186
187
|
readonly addNew: "Add New";
|
|
187
188
|
readonly new: "New";
|
|
188
189
|
readonly approve: "Approve";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/translations/base/en.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/translations/base/en.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBA2cU"}
|