@sonicjs-cms/core 1.0.0-alpha.1 → 1.0.0-alpha.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/chunk-24PWAFUT.cjs +776 -0
- package/dist/chunk-24PWAFUT.cjs.map +1 -0
- package/dist/chunk-4URGXJP7.js +3 -0
- package/dist/{chunk-PZ5AY32C.js.map → chunk-4URGXJP7.js.map} +1 -1
- package/dist/chunk-ALTMI5Y2.cjs +4 -0
- package/dist/{chunk-Q7SFCCGT.cjs.map → chunk-ALTMI5Y2.cjs.map} +1 -1
- package/dist/chunk-BOLQHE4J.cjs +11 -0
- package/dist/chunk-BOLQHE4J.cjs.map +1 -0
- package/dist/chunk-BRC3F4CG.cjs +792 -0
- package/dist/chunk-BRC3F4CG.cjs.map +1 -0
- package/dist/chunk-CXZDAR6S.js +2360 -0
- package/dist/chunk-CXZDAR6S.js.map +1 -0
- package/dist/chunk-EMMSS5I5.cjs +37 -0
- package/dist/chunk-EMMSS5I5.cjs.map +1 -0
- package/dist/chunk-G3PMV62Z.js +33 -0
- package/dist/chunk-G3PMV62Z.js.map +1 -0
- package/dist/chunk-HD7R6T6I.js +9 -0
- package/dist/chunk-HD7R6T6I.js.map +1 -0
- package/dist/chunk-KRJMGD4E.js +783 -0
- package/dist/chunk-KRJMGD4E.js.map +1 -0
- package/dist/chunk-L3NXO7Y4.cjs +3093 -0
- package/dist/chunk-L3NXO7Y4.cjs.map +1 -0
- package/dist/chunk-NRSL6BQI.js +3086 -0
- package/dist/chunk-NRSL6BQI.js.map +1 -0
- package/dist/chunk-PTQZ5FEI.js +755 -0
- package/dist/chunk-PTQZ5FEI.js.map +1 -0
- package/dist/chunk-WJ7QYVR2.cjs +2416 -0
- package/dist/chunk-WJ7QYVR2.cjs.map +1 -0
- package/dist/collection-config-FLlGtsh9.d.cts +107 -0
- package/dist/collection-config-FLlGtsh9.d.ts +107 -0
- package/dist/index-BlsY5XNH.d.ts +8333 -0
- package/dist/index-D45jaIlr.d.cts +8333 -0
- package/dist/index.cjs +365 -630
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -7962
- package/dist/index.d.ts +16 -7962
- package/dist/index.js +10 -592
- package/dist/index.js.map +1 -1
- package/dist/middleware.cjs +84 -4
- package/dist/middleware.cjs.map +1 -1
- package/dist/middleware.d.cts +203 -5
- package/dist/middleware.d.ts +203 -5
- package/dist/middleware.js +3 -6
- package/dist/middleware.js.map +1 -1
- package/dist/plugin-UzmDImQc.d.cts +357 -0
- package/dist/plugin-UzmDImQc.d.ts +357 -0
- package/dist/plugins.cjs +28 -4
- package/dist/plugins.cjs.map +1 -1
- package/dist/plugins.d.cts +326 -4
- package/dist/plugins.d.ts +326 -4
- package/dist/plugins.js +3 -6
- package/dist/plugins.js.map +1 -1
- package/dist/routes.cjs +7 -4
- package/dist/routes.cjs.map +1 -1
- package/dist/routes.d.cts +12 -3
- package/dist/routes.d.ts +12 -3
- package/dist/routes.js +2 -6
- package/dist/routes.js.map +1 -1
- package/dist/services.cjs +68 -4
- package/dist/services.cjs.map +1 -1
- package/dist/services.d.cts +5 -8
- package/dist/services.d.ts +5 -8
- package/dist/services.js +3 -6
- package/dist/services.js.map +1 -1
- package/dist/templates.cjs +35 -4
- package/dist/templates.cjs.map +1 -1
- package/dist/templates.d.cts +137 -5
- package/dist/templates.d.ts +137 -5
- package/dist/templates.js +2 -6
- package/dist/templates.js.map +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.d.cts +6 -462
- package/dist/types.d.ts +6 -462
- package/dist/types.js +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-PZ5AY32C.js +0 -9
- package/dist/chunk-Q7SFCCGT.cjs +0 -11
package/dist/routes.d.cts
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Routes Module Exports
|
|
3
3
|
*
|
|
4
|
-
* HTTP
|
|
4
|
+
* Note: HTTP routes are application-specific and should be implemented
|
|
5
|
+
* in the consuming application rather than in the core package.
|
|
6
|
+
*
|
|
7
|
+
* The core package provides the building blocks (middleware, services, types)
|
|
8
|
+
* but each application should define its own routes based on its specific needs.
|
|
9
|
+
*
|
|
10
|
+
* For reference implementations, see the main SonicJS repository.
|
|
5
11
|
*/
|
|
6
|
-
declare const
|
|
12
|
+
declare const ROUTES_INFO: {
|
|
13
|
+
readonly message: "Routes are application-specific - implement in your application";
|
|
14
|
+
readonly reference: "https://github.com/sonicjs/sonicjs";
|
|
15
|
+
};
|
|
7
16
|
|
|
8
|
-
export {
|
|
17
|
+
export { ROUTES_INFO };
|
package/dist/routes.d.ts
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Routes Module Exports
|
|
3
3
|
*
|
|
4
|
-
* HTTP
|
|
4
|
+
* Note: HTTP routes are application-specific and should be implemented
|
|
5
|
+
* in the consuming application rather than in the core package.
|
|
6
|
+
*
|
|
7
|
+
* The core package provides the building blocks (middleware, services, types)
|
|
8
|
+
* but each application should define its own routes based on its specific needs.
|
|
9
|
+
*
|
|
10
|
+
* For reference implementations, see the main SonicJS repository.
|
|
5
11
|
*/
|
|
6
|
-
declare const
|
|
12
|
+
declare const ROUTES_INFO: {
|
|
13
|
+
readonly message: "Routes are application-specific - implement in your application";
|
|
14
|
+
readonly reference: "https://github.com/sonicjs/sonicjs";
|
|
15
|
+
};
|
|
7
16
|
|
|
8
|
-
export {
|
|
17
|
+
export { ROUTES_INFO };
|
package/dist/routes.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// src/routes/index.ts
|
|
4
|
-
var placeholder = "routes";
|
|
5
|
-
|
|
6
|
-
export { placeholder };
|
|
1
|
+
export { ROUTES_INFO } from './chunk-HD7R6T6I.js';
|
|
2
|
+
import './chunk-G3PMV62Z.js';
|
|
7
3
|
//# sourceMappingURL=routes.js.map
|
|
8
4
|
//# sourceMappingURL=routes.js.map
|
package/dist/routes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"routes.js"}
|
package/dist/services.cjs
CHANGED
|
@@ -1,10 +1,74 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
require('./chunk-
|
|
3
|
+
require('./chunk-ALTMI5Y2.cjs');
|
|
4
|
+
var chunkWJ7QYVR2_cjs = require('./chunk-WJ7QYVR2.cjs');
|
|
5
|
+
require('./chunk-EMMSS5I5.cjs');
|
|
4
6
|
|
|
5
|
-
// src/services/index.ts
|
|
6
|
-
var placeholder = "services";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "Logger", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunkWJ7QYVR2_cjs.Logger; }
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "MigrationService", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return chunkWJ7QYVR2_cjs.MigrationService; }
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "PluginBootstrapService", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return chunkWJ7QYVR2_cjs.PluginBootstrapService; }
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports, "PluginService", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () { return chunkWJ7QYVR2_cjs.PluginService; }
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports, "cleanupRemovedCollections", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () { return chunkWJ7QYVR2_cjs.cleanupRemovedCollections; }
|
|
28
|
+
});
|
|
29
|
+
Object.defineProperty(exports, "fullCollectionSync", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function () { return chunkWJ7QYVR2_cjs.fullCollectionSync; }
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(exports, "getAvailableCollectionNames", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function () { return chunkWJ7QYVR2_cjs.getAvailableCollectionNames; }
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(exports, "getLogger", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () { return chunkWJ7QYVR2_cjs.getLogger; }
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(exports, "getManagedCollections", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function () { return chunkWJ7QYVR2_cjs.getManagedCollections; }
|
|
44
|
+
});
|
|
45
|
+
Object.defineProperty(exports, "initLogger", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: function () { return chunkWJ7QYVR2_cjs.initLogger; }
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(exports, "isCollectionManaged", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function () { return chunkWJ7QYVR2_cjs.isCollectionManaged; }
|
|
52
|
+
});
|
|
53
|
+
Object.defineProperty(exports, "loadCollectionConfig", {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
get: function () { return chunkWJ7QYVR2_cjs.loadCollectionConfig; }
|
|
56
|
+
});
|
|
57
|
+
Object.defineProperty(exports, "loadCollectionConfigs", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: function () { return chunkWJ7QYVR2_cjs.loadCollectionConfigs; }
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(exports, "syncCollection", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function () { return chunkWJ7QYVR2_cjs.syncCollection; }
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(exports, "syncCollections", {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () { return chunkWJ7QYVR2_cjs.syncCollections; }
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(exports, "validateCollectionConfig", {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: function () { return chunkWJ7QYVR2_cjs.validateCollectionConfig; }
|
|
72
|
+
});
|
|
9
73
|
//# sourceMappingURL=services.cjs.map
|
|
10
74
|
//# sourceMappingURL=services.cjs.map
|
package/dist/services.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"services.cjs"}
|
package/dist/services.d.cts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare const placeholder = "services";
|
|
7
|
-
|
|
8
|
-
export { placeholder };
|
|
1
|
+
export { C as CorePlugin, p as LogCategory, q as LogEntry, r as LogFilter, o as LogLevel, L as Logger, m as Migration, M as MigrationService, n as MigrationStatus, k as PluginBootstrapService, P as PluginService, e as cleanupRemovedCollections, f as fullCollectionSync, g as getAvailableCollectionNames, h as getLogger, d as getManagedCollections, j as initLogger, i as isCollectionManaged, a as loadCollectionConfig, l as loadCollectionConfigs, c as syncCollection, b as syncCollections, v as validateCollectionConfig } from './index-D45jaIlr.cjs';
|
|
2
|
+
import './collection-config-FLlGtsh9.cjs';
|
|
3
|
+
import '@cloudflare/workers-types';
|
|
4
|
+
import 'drizzle-zod';
|
|
5
|
+
import 'drizzle-orm/sqlite-core';
|
package/dist/services.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare const placeholder = "services";
|
|
7
|
-
|
|
8
|
-
export { placeholder };
|
|
1
|
+
export { C as CorePlugin, p as LogCategory, q as LogEntry, r as LogFilter, o as LogLevel, L as Logger, m as Migration, M as MigrationService, n as MigrationStatus, k as PluginBootstrapService, P as PluginService, e as cleanupRemovedCollections, f as fullCollectionSync, g as getAvailableCollectionNames, h as getLogger, d as getManagedCollections, j as initLogger, i as isCollectionManaged, a as loadCollectionConfig, l as loadCollectionConfigs, c as syncCollection, b as syncCollections, v as validateCollectionConfig } from './index-BlsY5XNH.js';
|
|
2
|
+
import './collection-config-FLlGtsh9.js';
|
|
3
|
+
import '@cloudflare/workers-types';
|
|
4
|
+
import 'drizzle-zod';
|
|
5
|
+
import 'drizzle-orm/sqlite-core';
|
package/dist/services.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import './chunk-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var placeholder = "services";
|
|
5
|
-
|
|
6
|
-
export { placeholder };
|
|
1
|
+
import './chunk-4URGXJP7.js';
|
|
2
|
+
export { Logger, MigrationService, PluginBootstrapService, PluginService, cleanupRemovedCollections, fullCollectionSync, getAvailableCollectionNames, getLogger, getManagedCollections, initLogger, isCollectionManaged, loadCollectionConfig, loadCollectionConfigs, syncCollection, syncCollections, validateCollectionConfig } from './chunk-CXZDAR6S.js';
|
|
3
|
+
import './chunk-G3PMV62Z.js';
|
|
7
4
|
//# sourceMappingURL=services.js.map
|
|
8
5
|
//# sourceMappingURL=services.js.map
|
package/dist/services.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"services.js"}
|
package/dist/templates.cjs
CHANGED
|
@@ -1,10 +1,41 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
require('./chunk-
|
|
3
|
+
var chunkBRC3F4CG_cjs = require('./chunk-BRC3F4CG.cjs');
|
|
4
|
+
require('./chunk-EMMSS5I5.cjs');
|
|
4
5
|
|
|
5
|
-
// src/templates/index.ts
|
|
6
|
-
var placeholder = "templates";
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "getConfirmationDialogScript", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkBRC3F4CG_cjs.getConfirmationDialogScript; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "renderAlert", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunkBRC3F4CG_cjs.renderAlert; }
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "renderConfirmationDialog", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return chunkBRC3F4CG_cjs.renderConfirmationDialog; }
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "renderFilterBar", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return chunkBRC3F4CG_cjs.renderFilterBar; }
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "renderForm", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return chunkBRC3F4CG_cjs.renderForm; }
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports, "renderFormField", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () { return chunkBRC3F4CG_cjs.renderFormField; }
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports, "renderPagination", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () { return chunkBRC3F4CG_cjs.renderPagination; }
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "renderTable", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () { return chunkBRC3F4CG_cjs.renderTable; }
|
|
39
|
+
});
|
|
9
40
|
//# sourceMappingURL=templates.cjs.map
|
|
10
41
|
//# sourceMappingURL=templates.cjs.map
|
package/dist/templates.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"templates.cjs"}
|
package/dist/templates.d.cts
CHANGED
|
@@ -1,8 +1,140 @@
|
|
|
1
|
+
interface FormField {
|
|
2
|
+
name: string;
|
|
3
|
+
label: string;
|
|
4
|
+
type: 'text' | 'email' | 'textarea' | 'select' | 'checkbox' | 'rich_text' | 'number' | 'date' | 'multi_select' | 'file';
|
|
5
|
+
value?: any;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
readonly?: boolean;
|
|
9
|
+
helpText?: string;
|
|
10
|
+
options?: Array<{
|
|
11
|
+
value: string;
|
|
12
|
+
label: string;
|
|
13
|
+
selected?: boolean;
|
|
14
|
+
}>;
|
|
15
|
+
rows?: number;
|
|
16
|
+
className?: string;
|
|
17
|
+
validation?: {
|
|
18
|
+
min?: number;
|
|
19
|
+
max?: number;
|
|
20
|
+
pattern?: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
interface FormData {
|
|
24
|
+
id?: string;
|
|
25
|
+
action?: string;
|
|
26
|
+
method?: string;
|
|
27
|
+
hxPost?: string;
|
|
28
|
+
hxPut?: string;
|
|
29
|
+
hxTarget?: string;
|
|
30
|
+
fields: FormField[];
|
|
31
|
+
submitButtons: Array<{
|
|
32
|
+
label: string;
|
|
33
|
+
type?: 'submit' | 'button';
|
|
34
|
+
value?: string;
|
|
35
|
+
name?: string;
|
|
36
|
+
className?: string;
|
|
37
|
+
onclick?: string;
|
|
38
|
+
}>;
|
|
39
|
+
title?: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
className?: string;
|
|
42
|
+
}
|
|
43
|
+
declare function renderForm(data: FormData): string;
|
|
44
|
+
declare function renderFormField(field: FormField): string;
|
|
45
|
+
|
|
46
|
+
interface TableColumn {
|
|
47
|
+
key: string;
|
|
48
|
+
label: string;
|
|
49
|
+
sortable?: boolean;
|
|
50
|
+
className?: string;
|
|
51
|
+
sortType?: 'string' | 'number' | 'date' | 'boolean';
|
|
52
|
+
render?: (value: any, row: any) => string;
|
|
53
|
+
}
|
|
54
|
+
interface TableData<T = any> {
|
|
55
|
+
columns: TableColumn[];
|
|
56
|
+
rows: T[];
|
|
57
|
+
selectable?: boolean;
|
|
58
|
+
className?: string;
|
|
59
|
+
emptyMessage?: string;
|
|
60
|
+
tableId?: string;
|
|
61
|
+
title?: string;
|
|
62
|
+
rowClickable?: boolean;
|
|
63
|
+
rowClickUrl?: (row: T) => string;
|
|
64
|
+
}
|
|
65
|
+
declare function renderTable<T = any>(data: TableData<T>): string;
|
|
66
|
+
|
|
67
|
+
interface PaginationData {
|
|
68
|
+
currentPage: number;
|
|
69
|
+
totalPages: number;
|
|
70
|
+
totalItems: number;
|
|
71
|
+
itemsPerPage: number;
|
|
72
|
+
startItem: number;
|
|
73
|
+
endItem: number;
|
|
74
|
+
baseUrl: string;
|
|
75
|
+
queryParams?: Record<string, string>;
|
|
76
|
+
showPageNumbers?: boolean;
|
|
77
|
+
maxPageNumbers?: number;
|
|
78
|
+
showPageSizeSelector?: boolean;
|
|
79
|
+
pageSizeOptions?: number[];
|
|
80
|
+
}
|
|
81
|
+
declare function renderPagination(data: PaginationData): string;
|
|
82
|
+
|
|
83
|
+
type AlertType = 'success' | 'error' | 'warning' | 'info';
|
|
84
|
+
interface AlertData {
|
|
85
|
+
type: AlertType;
|
|
86
|
+
title?: string;
|
|
87
|
+
message: string;
|
|
88
|
+
dismissible?: boolean;
|
|
89
|
+
className?: string;
|
|
90
|
+
icon?: boolean;
|
|
91
|
+
}
|
|
92
|
+
declare function renderAlert(data: AlertData): string;
|
|
93
|
+
|
|
94
|
+
interface ConfirmationDialogOptions {
|
|
95
|
+
id: string;
|
|
96
|
+
title: string;
|
|
97
|
+
message: string;
|
|
98
|
+
confirmText?: string;
|
|
99
|
+
cancelText?: string;
|
|
100
|
+
confirmClass?: string;
|
|
101
|
+
iconColor?: 'red' | 'yellow' | 'blue';
|
|
102
|
+
onConfirm?: string;
|
|
103
|
+
}
|
|
104
|
+
declare function renderConfirmationDialog(options: ConfirmationDialogOptions): string;
|
|
1
105
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* UI templates for admin interface
|
|
106
|
+
* Helper function to show a confirmation dialog programmatically
|
|
107
|
+
* Usage in templates: Add this script and call showConfirmDialog()
|
|
5
108
|
*/
|
|
6
|
-
declare
|
|
109
|
+
declare function getConfirmationDialogScript(): string;
|
|
110
|
+
|
|
111
|
+
interface FilterOption {
|
|
112
|
+
value: string;
|
|
113
|
+
label: string;
|
|
114
|
+
selected?: boolean;
|
|
115
|
+
color?: string;
|
|
116
|
+
}
|
|
117
|
+
interface Filter {
|
|
118
|
+
name: string;
|
|
119
|
+
label: string;
|
|
120
|
+
options: FilterOption[];
|
|
121
|
+
}
|
|
122
|
+
interface FilterBarData {
|
|
123
|
+
filters: Filter[];
|
|
124
|
+
actions?: Array<{
|
|
125
|
+
label: string;
|
|
126
|
+
className?: string;
|
|
127
|
+
onclick?: string;
|
|
128
|
+
hxGet?: string;
|
|
129
|
+
hxTarget?: string;
|
|
130
|
+
}>;
|
|
131
|
+
bulkActions?: Array<{
|
|
132
|
+
label: string;
|
|
133
|
+
value: string;
|
|
134
|
+
icon?: string;
|
|
135
|
+
className?: string;
|
|
136
|
+
}>;
|
|
137
|
+
}
|
|
138
|
+
declare function renderFilterBar(data: FilterBarData): string;
|
|
7
139
|
|
|
8
|
-
export {
|
|
140
|
+
export { type AlertData, type ConfirmationDialogOptions, type Filter, type FilterBarData, type FilterOption, type FormData, type FormField, type PaginationData, type TableColumn, type TableData, getConfirmationDialogScript, renderAlert, renderConfirmationDialog, renderFilterBar, renderForm, renderFormField, renderPagination, renderTable };
|
package/dist/templates.d.ts
CHANGED
|
@@ -1,8 +1,140 @@
|
|
|
1
|
+
interface FormField {
|
|
2
|
+
name: string;
|
|
3
|
+
label: string;
|
|
4
|
+
type: 'text' | 'email' | 'textarea' | 'select' | 'checkbox' | 'rich_text' | 'number' | 'date' | 'multi_select' | 'file';
|
|
5
|
+
value?: any;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
readonly?: boolean;
|
|
9
|
+
helpText?: string;
|
|
10
|
+
options?: Array<{
|
|
11
|
+
value: string;
|
|
12
|
+
label: string;
|
|
13
|
+
selected?: boolean;
|
|
14
|
+
}>;
|
|
15
|
+
rows?: number;
|
|
16
|
+
className?: string;
|
|
17
|
+
validation?: {
|
|
18
|
+
min?: number;
|
|
19
|
+
max?: number;
|
|
20
|
+
pattern?: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
interface FormData {
|
|
24
|
+
id?: string;
|
|
25
|
+
action?: string;
|
|
26
|
+
method?: string;
|
|
27
|
+
hxPost?: string;
|
|
28
|
+
hxPut?: string;
|
|
29
|
+
hxTarget?: string;
|
|
30
|
+
fields: FormField[];
|
|
31
|
+
submitButtons: Array<{
|
|
32
|
+
label: string;
|
|
33
|
+
type?: 'submit' | 'button';
|
|
34
|
+
value?: string;
|
|
35
|
+
name?: string;
|
|
36
|
+
className?: string;
|
|
37
|
+
onclick?: string;
|
|
38
|
+
}>;
|
|
39
|
+
title?: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
className?: string;
|
|
42
|
+
}
|
|
43
|
+
declare function renderForm(data: FormData): string;
|
|
44
|
+
declare function renderFormField(field: FormField): string;
|
|
45
|
+
|
|
46
|
+
interface TableColumn {
|
|
47
|
+
key: string;
|
|
48
|
+
label: string;
|
|
49
|
+
sortable?: boolean;
|
|
50
|
+
className?: string;
|
|
51
|
+
sortType?: 'string' | 'number' | 'date' | 'boolean';
|
|
52
|
+
render?: (value: any, row: any) => string;
|
|
53
|
+
}
|
|
54
|
+
interface TableData<T = any> {
|
|
55
|
+
columns: TableColumn[];
|
|
56
|
+
rows: T[];
|
|
57
|
+
selectable?: boolean;
|
|
58
|
+
className?: string;
|
|
59
|
+
emptyMessage?: string;
|
|
60
|
+
tableId?: string;
|
|
61
|
+
title?: string;
|
|
62
|
+
rowClickable?: boolean;
|
|
63
|
+
rowClickUrl?: (row: T) => string;
|
|
64
|
+
}
|
|
65
|
+
declare function renderTable<T = any>(data: TableData<T>): string;
|
|
66
|
+
|
|
67
|
+
interface PaginationData {
|
|
68
|
+
currentPage: number;
|
|
69
|
+
totalPages: number;
|
|
70
|
+
totalItems: number;
|
|
71
|
+
itemsPerPage: number;
|
|
72
|
+
startItem: number;
|
|
73
|
+
endItem: number;
|
|
74
|
+
baseUrl: string;
|
|
75
|
+
queryParams?: Record<string, string>;
|
|
76
|
+
showPageNumbers?: boolean;
|
|
77
|
+
maxPageNumbers?: number;
|
|
78
|
+
showPageSizeSelector?: boolean;
|
|
79
|
+
pageSizeOptions?: number[];
|
|
80
|
+
}
|
|
81
|
+
declare function renderPagination(data: PaginationData): string;
|
|
82
|
+
|
|
83
|
+
type AlertType = 'success' | 'error' | 'warning' | 'info';
|
|
84
|
+
interface AlertData {
|
|
85
|
+
type: AlertType;
|
|
86
|
+
title?: string;
|
|
87
|
+
message: string;
|
|
88
|
+
dismissible?: boolean;
|
|
89
|
+
className?: string;
|
|
90
|
+
icon?: boolean;
|
|
91
|
+
}
|
|
92
|
+
declare function renderAlert(data: AlertData): string;
|
|
93
|
+
|
|
94
|
+
interface ConfirmationDialogOptions {
|
|
95
|
+
id: string;
|
|
96
|
+
title: string;
|
|
97
|
+
message: string;
|
|
98
|
+
confirmText?: string;
|
|
99
|
+
cancelText?: string;
|
|
100
|
+
confirmClass?: string;
|
|
101
|
+
iconColor?: 'red' | 'yellow' | 'blue';
|
|
102
|
+
onConfirm?: string;
|
|
103
|
+
}
|
|
104
|
+
declare function renderConfirmationDialog(options: ConfirmationDialogOptions): string;
|
|
1
105
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* UI templates for admin interface
|
|
106
|
+
* Helper function to show a confirmation dialog programmatically
|
|
107
|
+
* Usage in templates: Add this script and call showConfirmDialog()
|
|
5
108
|
*/
|
|
6
|
-
declare
|
|
109
|
+
declare function getConfirmationDialogScript(): string;
|
|
110
|
+
|
|
111
|
+
interface FilterOption {
|
|
112
|
+
value: string;
|
|
113
|
+
label: string;
|
|
114
|
+
selected?: boolean;
|
|
115
|
+
color?: string;
|
|
116
|
+
}
|
|
117
|
+
interface Filter {
|
|
118
|
+
name: string;
|
|
119
|
+
label: string;
|
|
120
|
+
options: FilterOption[];
|
|
121
|
+
}
|
|
122
|
+
interface FilterBarData {
|
|
123
|
+
filters: Filter[];
|
|
124
|
+
actions?: Array<{
|
|
125
|
+
label: string;
|
|
126
|
+
className?: string;
|
|
127
|
+
onclick?: string;
|
|
128
|
+
hxGet?: string;
|
|
129
|
+
hxTarget?: string;
|
|
130
|
+
}>;
|
|
131
|
+
bulkActions?: Array<{
|
|
132
|
+
label: string;
|
|
133
|
+
value: string;
|
|
134
|
+
icon?: string;
|
|
135
|
+
className?: string;
|
|
136
|
+
}>;
|
|
137
|
+
}
|
|
138
|
+
declare function renderFilterBar(data: FilterBarData): string;
|
|
7
139
|
|
|
8
|
-
export {
|
|
140
|
+
export { type AlertData, type ConfirmationDialogOptions, type Filter, type FilterBarData, type FilterOption, type FormData, type FormField, type PaginationData, type TableColumn, type TableData, getConfirmationDialogScript, renderAlert, renderConfirmationDialog, renderFilterBar, renderForm, renderFormField, renderPagination, renderTable };
|
package/dist/templates.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// src/templates/index.ts
|
|
4
|
-
var placeholder = "templates";
|
|
5
|
-
|
|
6
|
-
export { placeholder };
|
|
1
|
+
export { getConfirmationDialogScript, renderAlert, renderConfirmationDialog, renderFilterBar, renderForm, renderFormField, renderPagination, renderTable } from './chunk-KRJMGD4E.js';
|
|
2
|
+
import './chunk-G3PMV62Z.js';
|
|
7
3
|
//# sourceMappingURL=templates.js.map
|
|
8
4
|
//# sourceMappingURL=templates.js.map
|
package/dist/templates.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"templates.js"}
|