@questpie/admin 3.0.3 → 3.0.4
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/README.md +34 -5
- package/dist/client/blocks/block-renderer.d.mts +2 -2
- package/dist/client/blocks/block-renderer.mjs +4 -1
- package/dist/client/builder/types/action-types.d.mts +31 -3
- package/dist/client/builder/types/collection-types.d.mts +140 -0
- package/dist/client/builder/types/ui-config.d.mts +16 -2
- package/dist/client/builder/types/views.d.mts +57 -0
- package/dist/client/builder/types/widget-types.d.mts +5 -0
- package/dist/client/components/actions/action-button.mjs +137 -199
- package/dist/client/components/actions/action-dialog.mjs +198 -156
- package/dist/client/components/actions/confirmation-dialog.mjs +2 -2
- package/dist/client/components/actions/header-actions.mjs +52 -53
- package/dist/client/components/admin-link.d.mts +2 -2
- package/dist/client/components/auth/auth-loading.mjs +41 -18
- package/dist/client/components/blocks/block-fields-renderer.mjs +64 -28
- package/dist/client/components/blocks/block-insert-button.mjs +4 -4
- package/dist/client/components/blocks/block-item.mjs +2 -2
- package/dist/client/components/blocks/block-library-sidebar.mjs +2 -2
- package/dist/client/components/component-renderer.mjs +1 -1
- package/dist/client/components/fields/array-field.mjs +14 -14
- package/dist/client/components/fields/asset-preview-field.mjs +1 -1
- package/dist/client/components/fields/blocks-field/blocks-field.mjs +84 -104
- package/dist/client/components/fields/json-field.mjs +2 -2
- package/dist/client/components/fields/object-array-field.mjs +22 -22
- package/dist/client/components/fields/object-field.mjs +5 -5
- package/dist/client/components/fields/relation/displays/cards-display.mjs +16 -9
- package/dist/client/components/fields/relation/displays/chips-display.mjs +15 -12
- package/dist/client/components/fields/relation/displays/grid-display.mjs +15 -11
- package/dist/client/components/fields/relation/displays/list-display.mjs +33 -20
- package/dist/client/components/fields/relation/displays/table-display.mjs +62 -93
- package/dist/client/components/fields/relation/relation-items-display.mjs +1 -1
- package/dist/client/components/fields/relation-picker.mjs +7 -6
- package/dist/client/components/fields/relation-select.mjs +71 -47
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +392 -82
- package/dist/client/components/fields/rich-text-editor/extensions.mjs +54 -23
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs +24 -50
- package/dist/client/components/fields/rich-text-editor/image-upload.mjs +66 -0
- package/dist/client/components/fields/rich-text-editor/index.d.mts +38 -0
- package/dist/client/components/fields/rich-text-editor/index.mjs +637 -376
- package/dist/client/components/fields/rich-text-editor/link-utils.mjs +26 -0
- package/dist/client/components/fields/rich-text-editor/presets.d.mts +10 -0
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +27 -6
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs +464 -346
- package/dist/client/components/fields/rich-text-editor/types.d.mts +77 -0
- package/dist/client/components/fields/upload-field.mjs +45 -49
- package/dist/client/components/filter-builder/columns-tab.mjs +69 -62
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs +473 -308
- package/dist/client/components/filter-builder/filters-tab.mjs +109 -82
- package/dist/client/components/filter-builder/saved-views-tab.mjs +300 -198
- package/dist/client/components/history-sidebar.mjs +850 -340
- package/dist/client/components/layout/field-layout-renderer.mjs +6 -5
- package/dist/client/components/locale-switcher.mjs +8 -8
- package/dist/client/components/media/media-grid.mjs +12 -9
- package/dist/client/components/media/media-picker-dialog.mjs +242 -230
- package/dist/client/components/preview/live-preview-mode.mjs +1 -1
- package/dist/client/components/primitives/asset-preview.mjs +37 -22
- package/dist/client/components/primitives/date-input.mjs +212 -249
- package/dist/client/components/primitives/dropzone.mjs +192 -159
- package/dist/client/components/primitives/field-select-control.mjs +93 -0
- package/dist/client/components/primitives/select-multi.mjs +251 -230
- package/dist/client/components/primitives/select-single.mjs +345 -290
- package/dist/client/components/primitives/time-input.mjs +2 -2
- package/dist/client/components/sheets/resource-sheet.mjs +2 -0
- package/dist/client/components/ui/accordion.mjs +4 -4
- package/dist/client/components/ui/alert.mjs +3 -3
- package/dist/client/components/ui/badge.mjs +4 -4
- package/dist/client/components/ui/button.mjs +47 -37
- package/dist/client/components/ui/card.mjs +2 -2
- package/dist/client/components/ui/checkbox.mjs +1 -1
- package/dist/client/components/ui/command.mjs +5 -5
- package/dist/client/components/ui/dialog.mjs +3 -3
- package/dist/client/components/ui/drawer.mjs +1 -1
- package/dist/client/components/ui/dropdown-menu.mjs +157 -15
- package/dist/client/components/ui/empty-state.mjs +88 -59
- package/dist/client/components/ui/field.mjs +2 -2
- package/dist/client/components/ui/input-group.mjs +3 -3
- package/dist/client/components/ui/input.mjs +1 -1
- package/dist/client/components/ui/kbd.mjs +1 -1
- package/dist/client/components/ui/label.mjs +1 -1
- package/dist/client/components/ui/popover.mjs +19 -11
- package/dist/client/components/ui/scroll-fade.mjs +170 -0
- package/dist/client/components/ui/search-input.mjs +1 -1
- package/dist/client/components/ui/select.mjs +129 -27
- package/dist/client/components/ui/sheet.mjs +54 -34
- package/dist/client/components/ui/sidebar.mjs +15 -14
- package/dist/client/components/ui/skeleton.mjs +28 -12
- package/dist/client/components/ui/switch.mjs +2 -2
- package/dist/client/components/ui/table.mjs +82 -74
- package/dist/client/components/ui/tabs.mjs +26 -31
- package/dist/client/components/ui/textarea.mjs +1 -1
- package/dist/client/components/ui/tooltip.mjs +1 -1
- package/dist/client/components/widgets/chart-widget.mjs +134 -96
- package/dist/client/components/widgets/progress-widget.mjs +59 -34
- package/dist/client/components/widgets/quick-actions-widget.mjs +184 -113
- package/dist/client/components/widgets/recent-items-widget.mjs +144 -102
- package/dist/client/components/widgets/stats-widget.mjs +91 -72
- package/dist/client/components/widgets/table-widget.mjs +159 -246
- package/dist/client/components/widgets/timeline-widget.mjs +66 -43
- package/dist/client/components/widgets/value-widget.mjs +261 -152
- package/dist/client/components/widgets/widget-empty-state.mjs +88 -0
- package/dist/client/components/widgets/widget-skeletons.mjs +53 -20
- package/dist/client/contexts/focus-context.d.mts +2 -2
- package/dist/client/hooks/use-action.mjs +63 -55
- package/dist/client/hooks/use-audit-history.mjs +1 -65
- package/dist/client/hooks/use-collection-validation.mjs +36 -23
- package/dist/client/hooks/use-collection.mjs +96 -1
- package/dist/client/hooks/use-saved-views.mjs +70 -49
- package/dist/client/hooks/use-server-actions.mjs +59 -40
- package/dist/client/hooks/use-server-validation.mjs +156 -41
- package/dist/client/hooks/use-server-widget-data.mjs +1 -1
- package/dist/client/hooks/use-setup-status.d.mts +3 -3
- package/dist/client/hooks/use-setup-status.mjs +2 -2
- package/dist/client/hooks/use-transition-stage.mjs +2 -10
- package/dist/client/hooks/use-validation-error-map.mjs +31 -13
- package/dist/client/hooks/use-view-state.mjs +238 -174
- package/dist/client/i18n/date-locale.mjs +33 -0
- package/dist/client/i18n/hooks.mjs +17 -1
- package/dist/client/lib/utils.mjs +3 -2
- package/dist/client/preview/block-scope-context.d.mts +2 -2
- package/dist/client/preview/preview-banner.d.mts +2 -2
- package/dist/client/preview/preview-field.d.mts +4 -4
- package/dist/client/preview/preview-field.mjs +2 -2
- package/dist/client/runtime/provider.mjs +8 -1
- package/dist/client/runtime/translations-provider.mjs +1 -1
- package/dist/client/scope/picker.d.mts +2 -2
- package/dist/client/scope/provider.d.mts +2 -2
- package/dist/client/styles/base.css +1022 -0
- package/dist/client/styles/index.css +3 -589
- package/dist/client/utils/auto-expand-fields.mjs +4 -2
- package/dist/client/utils/keyboard-shortcuts.mjs +26 -0
- package/dist/client/utils/use-lazy-component.mjs +80 -0
- package/dist/client/views/auth/auth-layout.d.mts +18 -11
- package/dist/client/views/auth/auth-layout.mjs +291 -80
- package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
- package/dist/client/views/auth/forgot-password-form.mjs +2 -2
- package/dist/client/views/auth/login-form.d.mts +2 -2
- package/dist/client/views/auth/login-form.mjs +1 -1
- package/dist/client/views/auth/reset-password-form.d.mts +2 -2
- package/dist/client/views/auth/reset-password-form.mjs +2 -2
- package/dist/client/views/auth/setup-form.d.mts +2 -2
- package/dist/client/views/collection/auto-form-fields.mjs +11 -9
- package/dist/client/views/collection/bulk-action-toolbar.mjs +173 -138
- package/dist/client/views/collection/cells/complex-cells.mjs +22 -22
- package/dist/client/views/collection/cells/primitive-cells.mjs +1 -1
- package/dist/client/views/collection/cells/relation-cells.mjs +147 -129
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +224 -278
- package/dist/client/views/collection/cells/shared/relation-chip.mjs +64 -36
- package/dist/client/views/collection/cells/upload-cells.mjs +199 -9
- package/dist/client/views/collection/columns/build-columns.mjs +29 -9
- package/dist/client/views/collection/columns/column-defaults.mjs +2 -2
- package/dist/client/views/collection/field-renderer.mjs +50 -89
- package/dist/client/views/collection/form-view.mjs +237 -227
- package/dist/client/views/collection/table-view.mjs +1162 -229
- package/dist/client/views/collection/view-skeletons.mjs +222 -79
- package/dist/client/views/common/global-search.mjs +29 -18
- package/dist/client/views/dashboard/dashboard-grid.mjs +678 -501
- package/dist/client/views/dashboard/dashboard-widget.mjs +6 -3
- package/dist/client/views/dashboard/widget-card.mjs +23 -14
- package/dist/client/views/globals/global-form-view.mjs +634 -589
- package/dist/client/views/layout/admin-layout-provider.mjs +67 -70
- package/dist/client/views/layout/admin-layout.d.mts +3 -6
- package/dist/client/views/layout/admin-layout.mjs +149 -172
- package/dist/client/views/layout/admin-router.mjs +747 -544
- package/dist/client/views/layout/admin-sidebar.d.mts +38 -1
- package/dist/client/views/layout/admin-sidebar.mjs +751 -591
- package/dist/client/views/layout/admin-theme.d.mts +10 -0
- package/dist/client/views/layout/admin-theme.mjs +84 -0
- package/dist/client/views/layout/admin-view-layout.mjs +161 -0
- package/dist/client/views/pages/accept-invite-page.d.mts +2 -2
- package/dist/client/views/pages/accept-invite-page.mjs +49 -26
- package/dist/client/views/pages/dashboard-page.d.mts +2 -2
- package/dist/client/views/pages/forgot-password-page.d.mts +2 -2
- package/dist/client/views/pages/forgot-password-page.mjs +2 -19
- package/dist/client/views/pages/invite-page.d.mts +2 -2
- package/dist/client/views/pages/invite-page.mjs +2 -19
- package/dist/client/views/pages/login-page.d.mts +1 -1
- package/dist/client/views/pages/login-page.mjs +4 -21
- package/dist/client/views/pages/reset-password-page.d.mts +2 -2
- package/dist/client/views/pages/reset-password-page.mjs +3 -20
- package/dist/client/views/pages/setup-page.d.mts +2 -2
- package/dist/client/views/pages/setup-page.mjs +3 -20
- package/dist/client.d.mts +6 -2
- package/dist/client.mjs +2 -1
- package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
- package/dist/index.d.mts +6 -2
- package/dist/index.mjs +2 -1
- package/dist/server/augmentation/dashboard.d.mts +67 -3
- package/dist/server/augmentation/form-layout.d.mts +21 -0
- package/dist/server/augmentation/index.d.mts +1 -1
- package/dist/server/codegen/admin-client-template.mjs +4 -0
- package/dist/server/fields/blocks.d.mts +1 -1
- package/dist/server/fields/blocks.mjs +12 -0
- package/dist/server/fields/rich-text.d.mts +1 -1
- package/dist/server/fields/rich-text.mjs +8 -0
- package/dist/server/i18n/index.mjs +17 -1
- package/dist/server/i18n/messages/cs.mjs +23 -0
- package/dist/server/i18n/messages/de.mjs +23 -0
- package/dist/server/i18n/messages/en.mjs +64 -1
- package/dist/server/i18n/messages/es.mjs +23 -0
- package/dist/server/i18n/messages/fr.mjs +23 -0
- package/dist/server/i18n/messages/pl.mjs +23 -0
- package/dist/server/i18n/messages/pt.mjs +23 -0
- package/dist/server/i18n/messages/sk.mjs +83 -1
- package/dist/server/modules/admin/block/introspection.mjs +4 -1
- package/dist/server/modules/admin/block/prefetch.mjs +12 -2
- package/dist/server/modules/admin/collections/account.d.mts +50 -50
- package/dist/server/modules/admin/collections/admin-locks.d.mts +54 -54
- package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
- package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
- package/dist/server/modules/admin/collections/apikey.d.mts +68 -68
- package/dist/server/modules/admin/collections/assets.d.mts +20 -20
- package/dist/server/modules/admin/collections/assets.mjs +0 -1
- package/dist/server/modules/admin/collections/session.d.mts +42 -42
- package/dist/server/modules/admin/collections/user.d.mts +12 -0
- package/dist/server/modules/admin/collections/user.mjs +40 -9
- package/dist/server/modules/admin/collections/verification.d.mts +2 -2
- package/dist/server/modules/admin/dto/admin-config.dto.mjs +2 -0
- package/dist/server/modules/admin/factories.mjs +7 -18
- package/dist/server/modules/admin/index.d.mts +1 -1
- package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
- package/dist/server/modules/admin/routes/admin-config.mjs +34 -16
- package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
- package/dist/server/modules/admin/routes/execute-action.mjs +33 -0
- package/dist/server/modules/admin/routes/locales.d.mts +2 -2
- package/dist/server/modules/admin/routes/preview.d.mts +11 -11
- package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
- package/dist/server/modules/admin/routes/setup.d.mts +10 -10
- package/dist/server/modules/admin/routes/setup.mjs +7 -7
- package/dist/server/modules/admin/routes/translations.d.mts +4 -4
- package/dist/server/modules/admin/routes/translations.mjs +5 -1
- package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
- package/dist/server/modules/admin-preferences/collections/admin-preferences.mjs +1 -1
- package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +27 -27
- package/dist/server/modules/audit/.generated/module.d.mts +1 -1
- package/dist/server/modules/audit/.generated/module.mjs +1 -1
- package/dist/server/modules/audit/collections/audit-log.d.mts +2 -2
- package/dist/server/modules/audit/collections/audit-log.mjs +1 -1
- package/dist/server/modules/audit/config/app.mjs +99 -42
- package/dist/server/modules/audit/jobs/audit-cleanup.mjs +1 -1
- package/dist/server/plugin.mjs +4 -2
- package/dist/server/proxy-factories.d.mts +4 -3
- package/dist/server/proxy-factories.mjs +34 -8
- package/dist/shared/types/saved-views.types.d.mts +2 -0
- package/package.json +6 -4
- package/dist/client/components/fields/rich-text-editor/link-popover.mjs +0 -85
- package/dist/client/components/ui/spinner.mjs +0 -52
- package/dist/client/components/ui/toolbar.mjs +0 -136
- package/dist/client/contexts/breadcrumb-context.mjs +0 -60
- package/dist/client/views/layout/admin-topbar.mjs +0 -236
package/dist/server/plugin.mjs
CHANGED
|
@@ -60,6 +60,7 @@ function adminPlugin() {
|
|
|
60
60
|
dirs: ["blocks"],
|
|
61
61
|
prefix: "bloc",
|
|
62
62
|
factoryFunctions: ["block"],
|
|
63
|
+
keyFromProperty: "state.name",
|
|
63
64
|
registryKey: true,
|
|
64
65
|
includeInAppState: true,
|
|
65
66
|
extractFromModules: true,
|
|
@@ -261,7 +262,7 @@ function adminPlugin() {
|
|
|
261
262
|
block: {
|
|
262
263
|
dir: "blocks",
|
|
263
264
|
description: "Server-side block definition",
|
|
264
|
-
template: ({ kebab, camel }) => `import { block } from "#questpie/factories";\n\nexport const ${camel}Block = block("${kebab}")\n\t.fields(({ f }) => ({\n\t\ttitle: f.text("Title"),\n\t}));\n`
|
|
265
|
+
template: ({ kebab, camel }) => `import { block } from "#questpie/factories";\n\nexport const ${camel}Block = block("${kebab}")\n\t.fields(({ f }) => ({\n\t\ttitle: f.text(255).label("Title").required(),\n\t}));\n`
|
|
265
266
|
},
|
|
266
267
|
view: {
|
|
267
268
|
dir: "views",
|
|
@@ -283,6 +284,7 @@ function adminPlugin() {
|
|
|
283
284
|
blocks: {
|
|
284
285
|
dirs: ["blocks"],
|
|
285
286
|
prefix: "block",
|
|
287
|
+
keyFromSource: "basename",
|
|
286
288
|
registryKey: false,
|
|
287
289
|
includeInAppState: false,
|
|
288
290
|
extractFromModules: false
|
|
@@ -340,7 +342,7 @@ function adminPlugin() {
|
|
|
340
342
|
const varName = `${key}Block`;
|
|
341
343
|
const kebab = file.importPath.split("/").pop();
|
|
342
344
|
ctx.addImport(`type { ${varName} }`, `../../server/blocks/${kebab}`);
|
|
343
|
-
entries.push(`${JSON.stringify(
|
|
345
|
+
entries.push(`${JSON.stringify(kebab)}: typeof ${varName}`);
|
|
344
346
|
}
|
|
345
347
|
ctx.addTypeDeclaration(`type _ServerBlocks = { ${entries.join("; ")} };`);
|
|
346
348
|
ctx.addTypeDeclaration("");
|
|
@@ -20,10 +20,11 @@ declare function createViewCallbackProxy(): Record<string, (config?: Record<stri
|
|
|
20
20
|
*/
|
|
21
21
|
declare function createComponentCallbackProxy(): Record<string, (...args: unknown[]) => Record<string, unknown>>;
|
|
22
22
|
/**
|
|
23
|
-
* Create
|
|
24
|
-
* Provides a `custom()` method and returns action names as strings for built-in actions.
|
|
23
|
+
* Create an action proxy for builder callback contexts.
|
|
25
24
|
*
|
|
26
|
-
*
|
|
25
|
+
* The same `a` proxy is used by `.list()` (`a.delete`) and `.actions()`
|
|
26
|
+
* (`a.delete()`, `a.headerAction(...)`), so built-ins are callable values that
|
|
27
|
+
* also serialize back to their action name.
|
|
27
28
|
*/
|
|
28
29
|
declare function createActionCallbackProxy(): Record<string, unknown>;
|
|
29
30
|
/**
|
|
@@ -66,18 +66,44 @@ function createComponentCallbackProxy() {
|
|
|
66
66
|
});
|
|
67
67
|
} });
|
|
68
68
|
}
|
|
69
|
+
function createBuiltinActionReference(name) {
|
|
70
|
+
const ref = (() => name);
|
|
71
|
+
Object.defineProperties(ref, {
|
|
72
|
+
type: { value: name },
|
|
73
|
+
toJSON: { value: () => name },
|
|
74
|
+
valueOf: { value: () => name },
|
|
75
|
+
[Symbol.toPrimitive]: { value: () => name }
|
|
76
|
+
});
|
|
77
|
+
return ref;
|
|
78
|
+
}
|
|
69
79
|
/**
|
|
70
|
-
* Create
|
|
71
|
-
* Provides a `custom()` method and returns action names as strings for built-in actions.
|
|
80
|
+
* Create an action proxy for builder callback contexts.
|
|
72
81
|
*
|
|
73
|
-
*
|
|
82
|
+
* The same `a` proxy is used by `.list()` (`a.delete`) and `.actions()`
|
|
83
|
+
* (`a.delete()`, `a.headerAction(...)`), so built-ins are callable values that
|
|
84
|
+
* also serialize back to their action name.
|
|
74
85
|
*/
|
|
75
86
|
function createActionCallbackProxy() {
|
|
76
|
-
return new Proxy({
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
87
|
+
return new Proxy({
|
|
88
|
+
custom: (name, config) => ({
|
|
89
|
+
type: name,
|
|
90
|
+
...config ? { config } : {}
|
|
91
|
+
}),
|
|
92
|
+
action: (def) => ({
|
|
93
|
+
scope: "single",
|
|
94
|
+
...def
|
|
95
|
+
}),
|
|
96
|
+
bulkAction: (def) => ({
|
|
97
|
+
...def,
|
|
98
|
+
scope: "bulk"
|
|
99
|
+
}),
|
|
100
|
+
headerAction: (def) => ({
|
|
101
|
+
...def,
|
|
102
|
+
scope: "header"
|
|
103
|
+
})
|
|
104
|
+
}, { get: (target, prop) => {
|
|
105
|
+
if (prop === "then") return void 0;
|
|
106
|
+
return target[prop] ?? createBuiltinActionReference(String(prop));
|
|
81
107
|
} });
|
|
82
108
|
}
|
|
83
109
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@questpie/admin",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/questpie/questpie.git",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"./server": "./dist/server.mjs",
|
|
29
29
|
"./shared": "./dist/shared.mjs",
|
|
30
30
|
"./*": "./*",
|
|
31
|
+
"./client/styles/base.css": "./dist/client/styles/base.css",
|
|
31
32
|
"./client/styles/index.css": "./dist/client/styles/index.css"
|
|
32
33
|
},
|
|
33
34
|
"publishConfig": {
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
"./server": "./dist/server.mjs",
|
|
41
42
|
"./shared": "./dist/shared.mjs",
|
|
42
43
|
"./*": "./*",
|
|
44
|
+
"./client/styles/base.css": "./dist/client/styles/base.css",
|
|
43
45
|
"./client/styles/index.css": "./dist/client/styles/index.css"
|
|
44
46
|
}
|
|
45
47
|
},
|
|
@@ -60,7 +62,7 @@
|
|
|
60
62
|
"@fontsource-variable/jetbrains-mono": "^5.2.8",
|
|
61
63
|
"@hookform/resolvers": "^5.1.0",
|
|
62
64
|
"@iconify/react": "^6.0.2",
|
|
63
|
-
"@questpie/tanstack-query": "^3.0.
|
|
65
|
+
"@questpie/tanstack-query": "^3.0.4",
|
|
64
66
|
"@tailwindcss/vite": "^4.0.6",
|
|
65
67
|
"@tiptap/core": "^2.x",
|
|
66
68
|
"@tiptap/extension-character-count": "^2.x",
|
|
@@ -86,7 +88,7 @@
|
|
|
86
88
|
"date-fns": "^4.1.0",
|
|
87
89
|
"lowlight": "^3.x",
|
|
88
90
|
"next-themes": "^0.4.6",
|
|
89
|
-
"questpie": "^3.0.
|
|
91
|
+
"questpie": "^3.0.4",
|
|
90
92
|
"react-day-picker": "^9.12.0",
|
|
91
93
|
"react-hook-form": "^7.54.0",
|
|
92
94
|
"react-resizable-panels": "^4.4.2",
|
|
@@ -101,11 +103,11 @@
|
|
|
101
103
|
},
|
|
102
104
|
"devDependencies": {
|
|
103
105
|
"@rollup/plugin-babel": "^6.1.0",
|
|
104
|
-
"bun-types": "latest",
|
|
105
106
|
"@tanstack/db": "^0.1.1",
|
|
106
107
|
"@types/react": "^19.2.0",
|
|
107
108
|
"@types/react-dom": "^19.2.0",
|
|
108
109
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
110
|
+
"bun-types": "latest",
|
|
109
111
|
"shadcn": "^3.6.1",
|
|
110
112
|
"tinyglobby": "^0.2.15",
|
|
111
113
|
"tsdown": "^0.18.3",
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { useTranslation } from "../../../i18n/hooks.mjs";
|
|
2
|
-
import { Button } from "../../ui/button.mjs";
|
|
3
|
-
import { Input } from "../../ui/input.mjs";
|
|
4
|
-
import { Popover, PopoverContent, PopoverHeader, PopoverTitle, PopoverTrigger } from "../../ui/popover.mjs";
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
|
|
8
|
-
//#region src/client/components/fields/rich-text-editor/link-popover.tsx
|
|
9
|
-
/**
|
|
10
|
-
* Link insertion/editing popover
|
|
11
|
-
*/
|
|
12
|
-
function LinkPopover({ editor, open, onOpenChange, disabled }) {
|
|
13
|
-
const { t } = useTranslation();
|
|
14
|
-
const [linkUrl, setLinkUrl] = React.useState("");
|
|
15
|
-
const prevOpenRef = React.useRef(false);
|
|
16
|
-
if (open && !prevOpenRef.current && editor) {
|
|
17
|
-
const currentLink = editor.getAttributes("link").href;
|
|
18
|
-
setLinkUrl(currentLink || "");
|
|
19
|
-
}
|
|
20
|
-
prevOpenRef.current = open;
|
|
21
|
-
const handleApplyLink = React.useCallback(() => {
|
|
22
|
-
if (!editor) return;
|
|
23
|
-
if (!linkUrl) {
|
|
24
|
-
editor.chain().focus().unsetLink().run();
|
|
25
|
-
onOpenChange(false);
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
editor.chain().focus().setLink({
|
|
29
|
-
href: linkUrl,
|
|
30
|
-
target: "_blank",
|
|
31
|
-
rel: "noopener noreferrer"
|
|
32
|
-
}).run();
|
|
33
|
-
onOpenChange(false);
|
|
34
|
-
}, [
|
|
35
|
-
editor,
|
|
36
|
-
linkUrl,
|
|
37
|
-
onOpenChange
|
|
38
|
-
]);
|
|
39
|
-
const handleRemoveLink = React.useCallback(() => {
|
|
40
|
-
if (!editor) return;
|
|
41
|
-
editor.chain().focus().unsetLink().run();
|
|
42
|
-
onOpenChange(false);
|
|
43
|
-
}, [editor, onOpenChange]);
|
|
44
|
-
return /* @__PURE__ */ jsxs(Popover, {
|
|
45
|
-
open,
|
|
46
|
-
onOpenChange,
|
|
47
|
-
children: [/* @__PURE__ */ jsx(PopoverTrigger, { render: /* @__PURE__ */ jsx("div", { className: "sr-only" }) }), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
48
|
-
className: "w-72",
|
|
49
|
-
children: [/* @__PURE__ */ jsx(PopoverHeader, { children: /* @__PURE__ */ jsx(PopoverTitle, { children: t("editor.link") }) }), /* @__PURE__ */ jsxs("div", {
|
|
50
|
-
className: "space-y-2",
|
|
51
|
-
children: [/* @__PURE__ */ jsx(Input, {
|
|
52
|
-
value: linkUrl,
|
|
53
|
-
placeholder: "https://example.com",
|
|
54
|
-
onChange: (event) => setLinkUrl(event.target.value),
|
|
55
|
-
onKeyDown: (event_0) => {
|
|
56
|
-
if (event_0.key === "Enter") {
|
|
57
|
-
event_0.preventDefault();
|
|
58
|
-
handleApplyLink();
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
disabled
|
|
62
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
63
|
-
className: "flex justify-end gap-2",
|
|
64
|
-
children: [/* @__PURE__ */ jsx(Button, {
|
|
65
|
-
type: "button",
|
|
66
|
-
size: "xs",
|
|
67
|
-
variant: "outline",
|
|
68
|
-
onClick: handleRemoveLink,
|
|
69
|
-
disabled: disabled || !editor?.isActive("link"),
|
|
70
|
-
children: t("common.remove")
|
|
71
|
-
}), /* @__PURE__ */ jsx(Button, {
|
|
72
|
-
type: "button",
|
|
73
|
-
size: "xs",
|
|
74
|
-
onClick: handleApplyLink,
|
|
75
|
-
disabled,
|
|
76
|
-
children: t("common.apply")
|
|
77
|
-
})]
|
|
78
|
-
})]
|
|
79
|
-
})]
|
|
80
|
-
})]
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
//#endregion
|
|
85
|
-
export { LinkPopover };
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { cn } from "../../lib/utils.mjs";
|
|
2
|
-
import { c } from "react/compiler-runtime";
|
|
3
|
-
import { Icon } from "@iconify/react";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
|
|
6
|
-
//#region src/client/components/ui/spinner.tsx
|
|
7
|
-
function Spinner(t0) {
|
|
8
|
-
const $ = c(10);
|
|
9
|
-
let className;
|
|
10
|
-
let props;
|
|
11
|
-
if ($[0] !== t0) {
|
|
12
|
-
({className, ...props} = t0);
|
|
13
|
-
$[0] = t0;
|
|
14
|
-
$[1] = className;
|
|
15
|
-
$[2] = props;
|
|
16
|
-
} else {
|
|
17
|
-
className = $[1];
|
|
18
|
-
props = $[2];
|
|
19
|
-
}
|
|
20
|
-
let t1;
|
|
21
|
-
if ($[3] !== className) {
|
|
22
|
-
t1 = cn("qa-spinner inline-flex size-4 animate-spin", className);
|
|
23
|
-
$[3] = className;
|
|
24
|
-
$[4] = t1;
|
|
25
|
-
} else t1 = $[4];
|
|
26
|
-
let t2;
|
|
27
|
-
if ($[5] !== props) {
|
|
28
|
-
t2 = /* @__PURE__ */ jsx(Icon, {
|
|
29
|
-
icon: "ph:spinner",
|
|
30
|
-
role: "status",
|
|
31
|
-
"aria-label": "Loading",
|
|
32
|
-
className: "size-full",
|
|
33
|
-
...props
|
|
34
|
-
});
|
|
35
|
-
$[5] = props;
|
|
36
|
-
$[6] = t2;
|
|
37
|
-
} else t2 = $[6];
|
|
38
|
-
let t3;
|
|
39
|
-
if ($[7] !== t1 || $[8] !== t2) {
|
|
40
|
-
t3 = /* @__PURE__ */ jsx("span", {
|
|
41
|
-
className: t1,
|
|
42
|
-
children: t2
|
|
43
|
-
});
|
|
44
|
-
$[7] = t1;
|
|
45
|
-
$[8] = t2;
|
|
46
|
-
$[9] = t3;
|
|
47
|
-
} else t3 = $[9];
|
|
48
|
-
return t3;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
//#endregion
|
|
52
|
-
export { Spinner };
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { cn } from "../../lib/utils.mjs";
|
|
2
|
-
import { c } from "react/compiler-runtime";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
|
|
5
|
-
//#region src/client/components/ui/toolbar.tsx
|
|
6
|
-
/**
|
|
7
|
-
* Toolbar - Container for toolbar elements with glass effect
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```tsx
|
|
11
|
-
* <Toolbar>
|
|
12
|
-
* <ToolbarSection className="flex-1">
|
|
13
|
-
* <SearchInput value={search} onChange={setSearch} />
|
|
14
|
-
* </ToolbarSection>
|
|
15
|
-
* <ToolbarSeparator />
|
|
16
|
-
* <ToolbarSection>
|
|
17
|
-
* <Button variant="outline" size="sm">Options</Button>
|
|
18
|
-
* </ToolbarSection>
|
|
19
|
-
* </Toolbar>
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
function Toolbar(t0) {
|
|
23
|
-
const $ = c(10);
|
|
24
|
-
let children;
|
|
25
|
-
let className;
|
|
26
|
-
let props;
|
|
27
|
-
if ($[0] !== t0) {
|
|
28
|
-
({children, className, ...props} = t0);
|
|
29
|
-
$[0] = t0;
|
|
30
|
-
$[1] = children;
|
|
31
|
-
$[2] = className;
|
|
32
|
-
$[3] = props;
|
|
33
|
-
} else {
|
|
34
|
-
children = $[1];
|
|
35
|
-
className = $[2];
|
|
36
|
-
props = $[3];
|
|
37
|
-
}
|
|
38
|
-
let t1;
|
|
39
|
-
if ($[4] !== className) {
|
|
40
|
-
t1 = cn("qa-toolbar bg-card border-border border", "flex items-center gap-2 p-1", className);
|
|
41
|
-
$[4] = className;
|
|
42
|
-
$[5] = t1;
|
|
43
|
-
} else t1 = $[5];
|
|
44
|
-
let t2;
|
|
45
|
-
if ($[6] !== children || $[7] !== props || $[8] !== t1) {
|
|
46
|
-
t2 = /* @__PURE__ */ jsx("div", {
|
|
47
|
-
"data-slot": "toolbar",
|
|
48
|
-
className: t1,
|
|
49
|
-
...props,
|
|
50
|
-
children
|
|
51
|
-
});
|
|
52
|
-
$[6] = children;
|
|
53
|
-
$[7] = props;
|
|
54
|
-
$[8] = t1;
|
|
55
|
-
$[9] = t2;
|
|
56
|
-
} else t2 = $[9];
|
|
57
|
-
return t2;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* ToolbarSection - Group of related toolbar elements
|
|
61
|
-
*/
|
|
62
|
-
function ToolbarSection(t0) {
|
|
63
|
-
const $ = c(10);
|
|
64
|
-
let children;
|
|
65
|
-
let className;
|
|
66
|
-
let props;
|
|
67
|
-
if ($[0] !== t0) {
|
|
68
|
-
({children, className, ...props} = t0);
|
|
69
|
-
$[0] = t0;
|
|
70
|
-
$[1] = children;
|
|
71
|
-
$[2] = className;
|
|
72
|
-
$[3] = props;
|
|
73
|
-
} else {
|
|
74
|
-
children = $[1];
|
|
75
|
-
className = $[2];
|
|
76
|
-
props = $[3];
|
|
77
|
-
}
|
|
78
|
-
let t1;
|
|
79
|
-
if ($[4] !== className) {
|
|
80
|
-
t1 = cn("qa-toolbar__section flex items-center gap-1", className);
|
|
81
|
-
$[4] = className;
|
|
82
|
-
$[5] = t1;
|
|
83
|
-
} else t1 = $[5];
|
|
84
|
-
let t2;
|
|
85
|
-
if ($[6] !== children || $[7] !== props || $[8] !== t1) {
|
|
86
|
-
t2 = /* @__PURE__ */ jsx("div", {
|
|
87
|
-
"data-slot": "toolbar-section",
|
|
88
|
-
className: t1,
|
|
89
|
-
...props,
|
|
90
|
-
children
|
|
91
|
-
});
|
|
92
|
-
$[6] = children;
|
|
93
|
-
$[7] = props;
|
|
94
|
-
$[8] = t1;
|
|
95
|
-
$[9] = t2;
|
|
96
|
-
} else t2 = $[9];
|
|
97
|
-
return t2;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* ToolbarSeparator - Vertical separator between toolbar sections
|
|
101
|
-
*/
|
|
102
|
-
function ToolbarSeparator(t0) {
|
|
103
|
-
const $ = c(8);
|
|
104
|
-
let className;
|
|
105
|
-
let props;
|
|
106
|
-
if ($[0] !== t0) {
|
|
107
|
-
({className, ...props} = t0);
|
|
108
|
-
$[0] = t0;
|
|
109
|
-
$[1] = className;
|
|
110
|
-
$[2] = props;
|
|
111
|
-
} else {
|
|
112
|
-
className = $[1];
|
|
113
|
-
props = $[2];
|
|
114
|
-
}
|
|
115
|
-
let t1;
|
|
116
|
-
if ($[3] !== className) {
|
|
117
|
-
t1 = cn("qa-toolbar__separator bg-border h-4 w-px", className);
|
|
118
|
-
$[3] = className;
|
|
119
|
-
$[4] = t1;
|
|
120
|
-
} else t1 = $[4];
|
|
121
|
-
let t2;
|
|
122
|
-
if ($[5] !== props || $[6] !== t1) {
|
|
123
|
-
t2 = /* @__PURE__ */ jsx("div", {
|
|
124
|
-
"data-slot": "toolbar-separator",
|
|
125
|
-
className: t1,
|
|
126
|
-
...props
|
|
127
|
-
});
|
|
128
|
-
$[5] = props;
|
|
129
|
-
$[6] = t1;
|
|
130
|
-
$[7] = t2;
|
|
131
|
-
} else t2 = $[7];
|
|
132
|
-
return t2;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
//#endregion
|
|
136
|
-
export { Toolbar, ToolbarSection, ToolbarSeparator };
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { c } from "react/compiler-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
|
|
5
|
-
//#region src/client/contexts/breadcrumb-context.tsx
|
|
6
|
-
const BreadcrumbContext = React.createContext(null);
|
|
7
|
-
function BreadcrumbProvider(t0) {
|
|
8
|
-
const $ = c(6);
|
|
9
|
-
const { children } = t0;
|
|
10
|
-
let t1;
|
|
11
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
12
|
-
t1 = [];
|
|
13
|
-
$[0] = t1;
|
|
14
|
-
} else t1 = $[0];
|
|
15
|
-
const [breadcrumbs, setBreadcrumbs] = React.useState(t1);
|
|
16
|
-
let t2;
|
|
17
|
-
if ($[1] !== breadcrumbs) {
|
|
18
|
-
t2 = {
|
|
19
|
-
breadcrumbs,
|
|
20
|
-
setBreadcrumbs
|
|
21
|
-
};
|
|
22
|
-
$[1] = breadcrumbs;
|
|
23
|
-
$[2] = t2;
|
|
24
|
-
} else t2 = $[2];
|
|
25
|
-
const value = t2;
|
|
26
|
-
let t3;
|
|
27
|
-
if ($[3] !== children || $[4] !== value) {
|
|
28
|
-
t3 = /* @__PURE__ */ jsx(BreadcrumbContext.Provider, {
|
|
29
|
-
value,
|
|
30
|
-
children
|
|
31
|
-
});
|
|
32
|
-
$[3] = children;
|
|
33
|
-
$[4] = value;
|
|
34
|
-
$[5] = t3;
|
|
35
|
-
} else t3 = $[5];
|
|
36
|
-
return t3;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Get breadcrumb context (optional - returns null if not in provider)
|
|
40
|
-
*/
|
|
41
|
-
function useBreadcrumbContextOptional() {
|
|
42
|
-
return React.useContext(BreadcrumbContext);
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Get current breadcrumbs (read-only)
|
|
46
|
-
*/
|
|
47
|
-
function useCurrentBreadcrumbs() {
|
|
48
|
-
const $ = c(2);
|
|
49
|
-
const context = useBreadcrumbContextOptional();
|
|
50
|
-
let t0;
|
|
51
|
-
if ($[0] !== context?.breadcrumbs) {
|
|
52
|
-
t0 = context?.breadcrumbs ?? [];
|
|
53
|
-
$[0] = context?.breadcrumbs;
|
|
54
|
-
$[1] = t0;
|
|
55
|
-
} else t0 = $[1];
|
|
56
|
-
return t0;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
//#endregion
|
|
60
|
-
export { BreadcrumbProvider, useCurrentBreadcrumbs };
|