Commit Graph

442 Commits

Author SHA1 Message Date
hykocx c74737e5d9 fix(ui): improve slash menu keyboard handling and adaptive positioning
- move slash menu keyboard listener to document capture phase to prevent contentEditable default behaviors
- use circular navigation for arrow keys in slash menu
- separate undo/redo shortcuts into dedicated global keydown handler
- add adaptive positioning for slash menu with flip-up, horizontal clamp, and max-height constraints
2026-04-25 17:46:04 -04:00
hykocx fdf35f36a3 chore: bump version to 1.4.138 2026-04-25 17:42:55 -04:00
hykocx 7fa2353296 style(BlockEditor): improve block spacing and placeholder visibility behavior
- increase block vertical padding from py-0.5 to py-1.5 for better readability
- increase editor container vertical padding from py-3 to py-6
- show placeholder text only on hover or focus instead of always visible
2026-04-25 17:42:51 -04:00
hykocx 645a54dba5 chore: bump version to 1.4.137 2026-04-25 17:37:26 -04:00
hykocx 54386d3fe3 feat(ui): add BlockEditor component with block types, slash menu, and drag-and-drop
- add BlockEditor orchestrator with controlled block list and keyboard navigation
- add Block client component with contentEditable sync, drag handles, and markdown shortcuts
- add SlashMenu for inserting block types via `/` command
- add blockRegistry and block type definitions (paragraph, heading, bullet list, numbered list, quote, code, divider)
- add caret and id utility helpers
- export BlockEditor from shared components index
- add BlockEditor demo to admin devkit ComponentsPage
- add README documenting usage and architecture
2026-04-25 17:37:23 -04:00
hykocx 0c99bf5002 chore: bump version to 1.4.136 2026-04-25 17:08:00 -04:00
hykocx 4e759767f2 feat(admin): add TagInput component demo to devkit components page
- import TagInput component and useState hook
- define ROLE_OPTIONS with color metadata for demo purposes
- add TagInputDemo wrapper component to manage local state
- add PreviewBlock showcasing default, colored badge, and error variants
2026-04-25 17:07:57 -04:00
hykocx 8b61da7322 chore: bump version to 1.4.135 2026-04-25 17:05:36 -04:00
hykocx cd6064b98f refactor(ui): replace RoleBadge with generic Badge component
- add `dot` and `onRemove` props to Badge for colored dot and removable tag support
- delete RoleBadge component in favor of Badge with dot prop
- update UserCreateModal, UserEditModal, and UsersPage to use Badge instead of RoleBadge
- remove RoleBadge export from shared components index
2026-04-25 17:05:32 -04:00
hykocx e78f5321e6 docs(modules): document AdminHeader component usage and clarify admin/components exports 2026-04-25 15:55:10 -04:00
hykocx 5474368a7e chore: bump version to 1.4.134 2026-04-25 15:15:31 -04:00
hykocx f14731e554 fix(cli): export ZenModulesClient component from client manifest to ensure side-effects execute in browser
- update `renderClientManifest` to export a `ZenModulesClient` React component instead of `export {}`
- update docs to explain why rendering the component is required under Next.js 15+/Turbopack and add usage example in `app/layout.js`
2026-04-25 15:15:27 -04:00
hykocx 9cdc945639 chore: bump version to 1.4.133 2026-04-25 15:05:31 -04:00
hykocx cb547f6400 docs(core): update server boundary rules and fix db import paths
- document `.server.js` suffix requirement for node-only imports in DEV.md
- add client-safe subentries table and server-only barrel warnings in MODULES.md
- fix `crud.js` and `database/index.js` to import from `db.server.js`
- replace `createRequire` with `pathToFileURL` in `discover.server.js` for ESM-only modules
- update admin navigation and registry to use safe client-compatible imports
- bump version to 1.4.132
2026-04-25 15:05:26 -04:00
hykocx 0b32e8aa97 refactor(database): rename db.js to db.server.js 2026-04-25 15:05:21 -04:00
hykocx eb87d9070d chore: bump version to 1.4.131 2026-04-25 14:43:08 -04:00
hykocx b460ed0619 docs(modules): update server/client boundary docs and client manifest generation
- update MODULES.md to document dual-entry pattern (main vs ./client) and explain why client entry must not import server-only code
- filter client manifest to only include modules exposing a `./client` subpath export
- add `moduleHasClientEntry` helper in discover.server.js to check package.json exports
- update cli.js to use `moduleHasClientEntry` when rendering the client manifest
- update init.js and modules/index.js to align with new client entry convention
2026-04-25 14:43:00 -04:00
hykocx 92f3e4c561 chore: bump version to 1.4.130 2026-04-25 14:34:46 -04:00
hykocx 1b85d6fac7 docs(modules): add client manifest generation and update discovery docs
- introduce `OUTPUT_CLIENT` constant and `renderClientManifest` for `'use client'` bundle
- rename `renderManifest` to `renderServerManifest` for clarity
- update `sync` command to write both server and client manifests
- update `findInstalledModuleNames` to support custom package path resolution
- rewrite MODULES.md to explain dual-manifest architecture and client hydration rationale
2026-04-25 14:34:43 -04:00
hykocx c793bc418c chore: bump version to 1.4.129 2026-04-25 14:25:06 -04:00
hykocx 94ab6c36cb docs(modules): update module discovery architecture to static manifest approach
- replace dynamic import strategy with static manifest generated by `zen-modules sync` cli
- add `zen-modules` binary entry point in `package.json`
- add `cli.js` implementing the `zen-modules sync` command
- update `discover.server.js` to consume static manifest instead of scanning at runtime
- update `index.js` to reflect new module registration flow
- update `init.js` to accept pre-resolved modules from manifest
- revise docs to document manifest format, sync triggers, and build requirements
2026-04-25 14:24:56 -04:00
hykocx c9a3634fc9 chore: bump version to 1.4.128 2026-04-25 13:14:44 -04:00
hykocx d6befcfa91 docs(modules): update module structure to reflect tsup build workflow
- fix entry point path from `index.js` to `src/index.js` compiled to `dist/index.js`
- update file tree to show `src/` as source root and `dist/` as published output
- update `package.json` example with correct `main`, `exports`, `files`, and build scripts
- add explanation of mandatory pre-build step before publish
- document why JSX must be compiled (turbopackIgnore + Node native resolution)
- add minimal `tsup.config.js` example with `bundle: false` and JSX loader
- add verification step to check compiled output before publishing
2026-04-25 13:13:07 -04:00
hykocx 65e833d020 chore: bump version to 1.4.127 2026-04-25 13:08:17 -04:00
hykocx 6b3bb6a4ee fix(storage): make next/headers import lazy in api.js to avoid module resolution failure
- replace top-level `import { cookies } from 'next/headers'` with lazy `await import('next/headers')` inside handler
- document the constraint in PROJECT.md: no top-level next/headers or next/navigation imports reachable from module register() chains
2026-04-25 13:08:14 -04:00
hykocx 7d6765b58b chore: bump version to 1.4.126 2026-04-25 13:01:10 -04:00
hykocx 7afcb2cb5a refactor(admin): split protect guards into dedicated export path
- remove `protectAdmin`/`isAdmin` re-exports from `features/admin/index.js` to avoid top-level `next/headers` import
- add `./features/admin/protect` export entry in `package.json`
- lazy-import `next/headers` in `router.js` `requireAuth` to defer resolution
- update `features/admin/README.md` to document new import paths
- translate `features/auth/index.js` comment to French for consistency
2026-04-25 13:01:06 -04:00
hykocx 6bbf3f1507 chore: bump version to 1.4.125 2026-04-25 12:52:36 -04:00
hykocx 34f0b9da22 refactor(auth): remove actions re-export from server barrel to avoid next/headers import issue
- update barrel comment to document why actions.js is excluded
- remove re-exports of server actions that depend on `next/headers` at module load time
- instruct consumers to import actions explicitly via @zen/core/features/auth/actions
2026-04-25 12:52:32 -04:00
hykocx b17895e162 chore: bump version to 1.4.124 2026-04-25 12:44:28 -04:00
hykocx 9f709df357 fix(discover): add turbopack and webpack ignore hints to dynamic import 2026-04-25 12:43:53 -04:00
hykocx 143d9bd2cc chore: bump version to 1.4.123 2026-04-25 12:39:25 -04:00
hykocx 7f89c35969 refactor(init): skip module register() call during db init to avoid next.js imports
- update comment to clarify that only manifest.permissions are registered before seed
- remove register() invocation from loadModules() to prevent incompatible next.js imports in cli context
2026-04-25 12:39:11 -04:00
hykocx de745cb924 docs: add root cause fix principle to coding standards
- add "no whack-a-mole" rule in CLAUDE.md to enforce fixing root causes over symptoms
- add equivalent root cause principle in docs/DEV.md coding standards section
2026-04-25 12:39:06 -04:00
hykocx 7c1341d439 docs(modules): update module file structure to use src/ layout
- move db.js, api.js and register-server.js under src/ with updated naming conventions
- add explanation of src/ as the module code directory with index.js as public entry point
- document index.js pattern for re-exporting register, createTables and dropTables from src/
- add package.json files field example to restrict published assets
2026-04-25 12:20:23 -04:00
hykocx e783a39ced chore: bump version to 1.4.122 2026-04-25 10:50:18 -04:00
hykocx a3aff9fa49 feat(modules): add external module system with auto-discovery and public pages support
- add `src/core/modules/` with registry, discovery (server), and public index
- add `src/core/public-pages/` with registry, server component, and public index
- add `src/core/users/permissions-registry.js` for runtime permission registration
- expose `./modules`, `./public-pages`, and `./public-pages/server` package exports
- rename `registerFeatureRoutes` to `registerApiRoutes` with backward-compatible alias
- extend `seedDefaultRolesAndPermissions` to include module-registered permissions
- update `initializeZen` and shared init to wire module discovery and registration
- add `docs/MODULES.md` documenting the `@zen/module-*` authoring contract
- update `docs/DEV.md` with references to module system docs
2026-04-25 10:50:13 -04:00
hykocx 3098940905 chore: bump version to 1.4.121 2026-04-25 10:12:37 -04:00
hykocx efc7c93c6b fix(auth): prevent admin from revoking their last users.manage role
- add self-lockout guard in handleRevokeUserRole api handler
- sequence role additions before removals and handle delete errors in UserEditModal
- document the security rule in core/users README
2026-04-25 10:12:31 -04:00
hykocx 78ba61e60e chore: bump version to 1.4.120 2026-04-25 10:02:54 -04:00
hykocx 0d6b06f217 feat(users): allow system roles to be renamed but not have permissions changed
- update `updateRole` to allow name changes for system roles while blocking permission updates
- remove edit button restriction for system roles in roles page
- disable name field only was replaced by disabling permissions checkboxes for system roles in edit modal
- update README to reflect new system role update policy
2026-04-25 10:02:51 -04:00
hykocx 584e96a00d chore: bump version to 1.4.119 2026-04-25 09:59:37 -04:00
hykocx 826ce3dcd1 fix(auth): prevent system roles from being updated
- throw error in updateRole when role is system-protected
- hide edit button in roles table for system roles
- update README to reflect roles cannot be modified (not just renamed)
2026-04-25 09:59:33 -04:00
hykocx ebdeea7287 chore: bump version to 1.4.118 2026-04-25 09:47:37 -04:00
hykocx 2360021376 refactor(users)!: merge users.edit and users.delete into users.manage permission
BREAKING CHANGE: permissions `users.edit` and `users.delete` have been replaced by a single `users.manage` permission; any role or code referencing the old keys must be updated

- remove `USERS_EDIT` and `USERS_DELETE` from `PERMISSIONS` and `PERMISSION_DEFINITIONS`
- add `USERS_MANAGE` permission covering create, edit and delete actions
- update `db.js` to use `users.manage` in permission checks
- update `auth/api.js` to reference the new permission key
- update `UsersPage.client.js` to check `users.manage` instead of old keys
- update `api/define.js` and all README examples to reflect the new key
2026-04-25 09:47:34 -04:00
hykocx 27ebc91d31 chore: bump version to 1.4.117 2026-04-25 09:39:06 -04:00
hykocx ab4ecd1ccf refactor(users): remove content, media, and settings permissions
- strip content.*, media.*, and settings.* permission keys from PERMISSIONS constant
- remove corresponding entries from PERMISSION_DEFINITIONS
- drop content and media permission groups from db seed data
- update README examples and permission table to reflect reduced scope
2026-04-25 09:39:00 -04:00
hykocx 2f91a8bcd3 chore: bump version to 1.4.116 2026-04-25 09:31:58 -04:00
hykocx 74bc3073a7 feat(admin): add permission-based widget visibility on dashboard
- add optional `permission` field to `registerWidget` api
- filter widgets in `DashboardPage` based on user permissions
- register users widget with `users.view` permission requirement
- document `permission` parameter in admin README
2026-04-25 09:31:54 -04:00
hykocx 01a08b0005 chore: bump version to 1.4.115 2026-04-25 09:27:10 -04:00