-
Notifications
You must be signed in to change notification settings - Fork 2
Extract calendar-view to plugin package #203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
198c086
Initial plan
Copilot 52cc1f2
Create plugin-calendar-view and move calendar-view component from com…
Copilot c0b953f
Move calendar-view renderer to plugin and remove from components package
Copilot 0be1d04
Address code review feedback - remove type assertions and improve typ…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # @object-ui/plugin-calendar-view | ||
|
|
||
| Full-featured calendar view plugin for Object UI with month, week, and day views. | ||
|
|
||
| ## Installation | ||
|
|
||
| ```bash | ||
| npm install @object-ui/plugin-calendar-view | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| ```tsx | ||
| import { CalendarView } from '@object-ui/plugin-calendar-view'; | ||
|
|
||
| const events = [ | ||
| { | ||
| id: 1, | ||
| title: 'Team Meeting', | ||
| start: new Date(2024, 0, 15, 10, 0), | ||
| end: new Date(2024, 0, 15, 11, 0), | ||
| }, | ||
| // ... more events | ||
| ]; | ||
|
|
||
| function App() { | ||
| return ( | ||
| <CalendarView | ||
| events={events} | ||
| view="month" | ||
| onEventClick={(event) => console.log('Event clicked:', event)} | ||
| onDateClick={(date) => console.log('Date clicked:', date)} | ||
| /> | ||
| ); | ||
| } | ||
| ``` | ||
|
|
||
| ## Features | ||
|
|
||
| - Month, week, and day views | ||
| - Event handling and display | ||
| - Customizable event colors | ||
| - All-day and timed events | ||
| - Responsive design | ||
| - Built with Tailwind CSS and Shadcn UI | ||
|
|
||
| ## License | ||
|
|
||
| MIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| { | ||
| "name": "@object-ui/plugin-calendar-view", | ||
| "version": "0.3.0", | ||
| "type": "module", | ||
| "license": "MIT", | ||
| "description": "Calendar view plugin for Object UI", | ||
| "homepage": "https://www.objectui.org", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/objectstack-ai/objectui.git", | ||
| "directory": "packages/plugin-calendar-view" | ||
| }, | ||
| "bugs": { | ||
| "url": "https://github.com/objectstack-ai/objectui/issues" | ||
| }, | ||
| "main": "dist/index.umd.cjs", | ||
| "module": "dist/index.js", | ||
| "types": "dist/index.d.ts", | ||
| "exports": { | ||
| ".": { | ||
| "types": "./dist/index.d.ts", | ||
| "import": "./dist/index.js", | ||
| "require": "./dist/index.umd.cjs" | ||
| } | ||
| }, | ||
| "scripts": { | ||
| "build": "vite build", | ||
| "test": "vitest run", | ||
| "test:watch": "vitest", | ||
| "type-check": "tsc --noEmit", | ||
| "lint": "eslint ." | ||
| }, | ||
| "dependencies": { | ||
| "@object-ui/components": "workspace:*", | ||
| "@object-ui/core": "workspace:*", | ||
| "@object-ui/react": "workspace:*", | ||
| "@object-ui/types": "workspace:*", | ||
| "lucide-react": "^0.468.0" | ||
| }, | ||
| "peerDependencies": { | ||
| "react": "^18.0.0 || ^19.0.0", | ||
| "react-dom": "^18.0.0 || ^19.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/react": "^19.0.6", | ||
| "@types/react-dom": "^19.0.3", | ||
| "@vitejs/plugin-react": "^4.2.1", | ||
| "typescript": "^5.9.3", | ||
| "vite": "^7.3.1", | ||
| "vite-plugin-dts": "^4.5.4" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "extends": "../../tsconfig.json", | ||
| "compilerOptions": { | ||
| "outDir": "dist", | ||
| "jsx": "react-jsx", | ||
| "baseUrl": ".", | ||
| "paths": { | ||
| "@/*": ["src/*"] | ||
| }, | ||
| "noEmit": false, | ||
| "declaration": true, | ||
| "composite": true, | ||
| "declarationMap": true, | ||
| "skipLibCheck": true | ||
| }, | ||
| "include": ["src"], | ||
| "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.test.tsx"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| /** | ||
| * ObjectUI | ||
| * Copyright (c) 2024-present ObjectStack Inc. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| */ | ||
|
|
||
| import { defineConfig } from 'vite'; | ||
| import react from '@vitejs/plugin-react'; | ||
| import dts from 'vite-plugin-dts'; | ||
| import { resolve } from 'path'; | ||
|
|
||
| export default defineConfig({ | ||
| plugins: [ | ||
| react(), | ||
| dts({ | ||
| insertTypesEntry: true, | ||
| include: ['src'], | ||
| exclude: ['**/*.test.ts', '**/*.test.tsx', 'node_modules'], | ||
| skipDiagnostics: true, | ||
| }), | ||
| ], | ||
| resolve: { | ||
| alias: { | ||
| '@': resolve(__dirname, './src'), | ||
| }, | ||
| }, | ||
| build: { | ||
| lib: { | ||
| entry: resolve(__dirname, 'src/index.tsx'), | ||
| name: 'ObjectUIPluginCalendarView', | ||
| fileName: 'index', | ||
| }, | ||
| rollupOptions: { | ||
| external: ['react', 'react-dom', '@object-ui/components', '@object-ui/core', '@object-ui/react', 'lucide-react'], | ||
| output: { | ||
| globals: { | ||
| react: 'React', | ||
| 'react-dom': 'ReactDOM', | ||
| '@object-ui/components': 'ObjectUIComponents', | ||
| '@object-ui/core': 'ObjectUICore', | ||
| '@object-ui/react': 'ObjectUIReact', | ||
| 'lucide-react': 'LucideReact', | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR removes the existing registration/render smoke tests for
calendar-view, but the extracted plugin package doesn’t appear to add replacement coverage. Since this is a large/complex component+renderer, consider adding at least a minimal test in@object-ui/plugin-calendar-viewto assert the ComponentRegistry registration and basic render with a simple schema.