feat/make-dokan-settings-components#53
feat/make-dokan-settings-components#53Aunshon wants to merge 47 commits intofeat/settings-componentsfrom
Conversation
… stories - Introduced new `Popover`, `Skeleton`, and `ScrollArea` components in the UI library. - Added Storybook stories for each component (`Popover.stories.tsx`, `Skeleton.stories.tsx`, `ScrollArea.stories.tsx`) showcasing their usage and variations. - Exported new components in the `ui/index.ts` for external use.
update: add cursor style for Button on mouse over
…tion - Added `ShowHideField` component to support toggling visibility of password-like fields. - Replaced `ToggleGroup` in `RadioCapsuleField` with `ButtonToggleGroup` for improved styling and functionality. - Enhanced event log UI in `Settings` stories with better empty state messaging. - Used `RawHTML` for safer and more consistent rendering of descriptions.
- Added `layout` prop with default "horizontal" option to `FieldWrapper` for flexible layouts. - Updated input wrapper to support responsive width. - Enhanced link styling in descriptions with `text-primary` and `underline` classes. - Introduced `layout` property in specific settings fields for full-width layout.
- Introduced `layout` prop in `FieldWrapper` with "horizontal" as default for flexible layouts. - Updated styles for input wrappers and added responsive width adjustments. - Enhanced prefix/postfix UX with better positioning and hover effects. - Added `doc_link_text` property across relevant settings fields for customizable link text. - Standardized `layout` and styling in other settings components and stories.
- Introduced `layout` prop in `FieldWrapper` with "horizontal" as default for flexible layouts. - Updated styles for input wrappers and added responsive width adjustments. - Enhanced prefix/postfix UX with better positioning and hover effects. - Added `doc_link_text` property across relevant settings fields for customizable link text. - Standardized `layout` and styling in other settings components and stories.
…ehavior - Adjusted `border-muted` for default states and refined `border-primary` application on selection. - Improved hover styles with `group-hover` for better visual feedback. - Simplified className logic for cleaner style definitions.
…ries - Used `RawHTML` for consistent rendering of `prefix` and `postfix` in field components. - Introduced comprehensive settings for product advertisement including cost, slots, and visibility options. - Added request-for-quote settings with toggles for AJAX functionality, redirect behavior, and out-of-stock quotes.
…d components - Updated image styles in settings components with rounded corners and borders for better visuals. - Included `doc_link_text` property across several settings for improved link customization. - Adjusted layout and spacing in `RadioGroup` and `FieldContent` for more consistent design. - Refined description and link styling with `text-primary` and `underline` classes.
…cing - Improved alignment and spacing by restructuring `Field` component layout. - Simplified wrapping div structure in `SettingsFieldGroup`.
feat: add Popover, Skeleton, and ScrollArea components with Storybook stories
…rt in settings - Introduced `ColorPickerField` for rendering color picker inputs in settings. - Added `ColorPicker` component using `@wordpress/components` for primary functionality. - Extended `fields` and `field-renderer` to support `color_picker` and `select_color_picker` variants. - Updated `Settings.stories` with a `Store Brand Color` field to demonstrate color picker usage.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughA comprehensive Settings component system is introduced with context-based state management, field rendering for multiple input types, sidebar navigation, and supporting utilities for data formatting, validation, and dependency resolution. Package.json is expanded with build scripts, dependencies, and public subpath exports. Storybook configuration is updated to support MDX files, and new UI components (ColorPicker, RadioImageCard) are added. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant SettingsUI as Settings UI
participant SettingsProvider as SettingsProvider
participant FieldRenderer as FieldRenderer
participant Context as Settings Context
User->>SettingsUI: Open Settings with schema
SettingsUI->>SettingsProvider: Initialize with schema/values
SettingsProvider->>SettingsProvider: Format & normalize schema
SettingsProvider->>Context: Set initial state (pages, values, errors)
User->>SettingsUI: Click sidebar item
SettingsUI->>Context: Update navigation (activePage/activeSubpage)
Context->>SettingsUI: Notify state change
SettingsUI->>SettingsUI: Re-render content area
User->>SettingsUI: Update field value
SettingsUI->>FieldRenderer: Trigger onChange
FieldRenderer->>Context: Call updateValue(scope, key, value)
Context->>Context: Validate field & update values
Context->>Context: Mark scope as dirty
SettingsUI->>SettingsUI: Re-render with updated state
User->>SettingsUI: Click Save button
SettingsUI->>Context: Trigger onSave with page values
Context->>SettingsUI: Call onSave callback
SettingsUI->>SettingsUI: Reset dirty state
sequenceDiagram
participant Schema as Schema (Flat Array)
participant Formatter as formatSettingsData()
participant Tree as Hierarchical Tree
participant Evaluator as evaluateDependencies()
participant Validator as validateField()
Schema->>Formatter: Pass flat settings array
Formatter->>Formatter: Resolve parent pointers (bottom-up)
Formatter->>Formatter: Construct root pages
Formatter->>Formatter: Enrich nodes recursively
Formatter->>Formatter: Normalize options & validations
Formatter->>Tree: Return hierarchical structure
Tree->>Evaluator: Element + values
Evaluator->>Evaluator: Evaluate dependencies
Evaluator->>Tree: Return shouldDisplay boolean
Tree->>Validator: Element + field value
Validator->>Validator: Check validation rules (required, min, max, etc.)
Validator->>Tree: Return error string or null
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Introduced `NoticeField` for rendering alert-style notices in settings. - Extended `field-renderer` to support the `notice` field variant. - Added `scrollBarClassName` prop to `ScrollArea` for improved customization. - Updated `settings-content` to use `ScrollArea` for consistent scrolling behavior.
- Introduced `CopyField` for rendering copyable input fields with flexible layouts. - Added `InfoField` to display information with titles, descriptions, and optional external links. - Extended `field-renderer` to support `copy_field` and `info` variants. - Updated `fields` and `ui` exports to include new components.
- Introduced `CopyInput`, a reusable input component with copy-to-clipboard functionality. - Added Storybook stories demonstrating various use cases, including labels, custom durations, and callbacks.
…ories - Enabled dynamic icon rendering in `FieldLabel` using Lucide icons. - Updated `Settings.stories` to include an example with the `CircleCheck` icon.
- Introduced `AI Assist` page with configurable settings for content generation. - Added support for OpenAI and Gemini APIs with selection fields for engine, API keys, and model options. - Enhanced `Settings.stories` with examples showcasing AI-powered product information generation.
…ents - Updated default AI engine values to `chatgpt` and refined model options for both ChatGPT and Gemini. - Enhanced image styles in settings with added padding and refined borders. - Improved link styling with `text-primary` and `hover:underline` classes. - Updated Gemini icon source for better visual consistency.
…ories - Introduced `Vendor` settings with `Vendor Onboarding` and `Vendor Capabilities` subsections. -
…ontent in `RawHTML`
- Introduced `RichTextField` to the field renderer for rich text editing. - Enhanced `RichTextEditor` with `value` and `onChange` support for better state control. - Added toolbar improvements, including a new link button and reordered undo/redo actions. - Updated `Settings.stories` with example usage of the rich text field.
…tings stories - Enabled dynamic rendering of `startIcon` and `endIcon` in field options using Lucide icons. - Updated `Settings.stories` to incorporate examples with new icon properties. - Refined tooltips, link styling, and external link visuals across settings stories. - Standardized `doc_link_text` for improved accessibility and clarity.
…customization - Added detailed tooltips for subscription fields to improve clarity. - Introduced email notification options for subscription expiry alerts, including subject and body customization. - Updated default values for alert days before expiry and enhanced related field descriptions.
- Introduced `GoogleAnalyticsField` to the field renderer for seamless integration with Google Analytics. - Added support for connecting, disconnecting, and selecting Analytics profiles via dropdown. - Updated `Settings.stories` to include examples showcasing the new field and its configurations
- Introduced `Vendor Verification` page with subsections for email verification, vendor verification settings, and SMS gateways. - Added support for email verification notices, marketplace verified icons, and verification methods. - Integrated Twilio and Vonage SMS gateway configurations with connect/disconnect options.
- Introduced `Transaction` page with subsections for commissions, fees, and withdrawal settings. - Added configurable fields for commission types (fixed/category-based), admin commission, and parent-category behavior. - Enhanced fee distribution options for shipping, product tax, and shipping tax. - Integrated withdrawal method configuration for PayPal and bank transfer, including fees and toggle switches.
… in settings - Added `CombineInput` component for percentage and number inputs with optional swapping and custom money signs. - Integrated `CombineInputField` into the field renderer for settings. - Updated `Settings.stories` with `combine_input` field examples, including swapped and automated use cases. - Added Storybook stories for `CombineInput` showcasing different configurations and interactivity.
- Added `isNested` and `isGroupParent` props to FieldRenderer and settings components to support advanced layout rendering. - Implemented `switch_group` variant logic, enabling grouped fields with toggle functionality. - Enhanced various field components (e.g., `TextField`, `SelectField`) to pass `...rest` props for nested styling. - Updated settings stories and types to include nested field scenarios with hierarchical dependencies.
…ayout adjustments - Added `isGroupParent` prop to multiple components for enhanced hierarchical rendering. - Updated child component logic to handle nested and grouped field layouts. - Refined spacing and styling for nested and grouped fields to improve visual hierarchy.
- Introduced `Shipment` page with sections for tracking, logging, and customer delivery confirmation. - Added configurable fields for enabling shipment tracking, API logging, and marking orders as received. - Integrated shipment provider options with switch-based enablement for multiple carriers. - Updated `Settings.stories` to reflect new shipment settings and provider configurations.
- Introduced `RadioIconCard` component for icon-based radio field rendering. - Added `radio_variant` field property to dynamically switch between `RadioImageCard` and `RadioIconCard`. - Updated `RadioGroup` to handle `RawHTML` labels and conditional layout adjustments. - Enhanced `Settings.stories` with examples using the new `RadioIconCard` and `radio_box` variant.
- Enhanced `Settings.stories` with updated external link styles (text-primary underline). - Introduced new `ImageCard` and `IconCard` stories showcasing `RadioImageCard` and `RadioIconCard` components. - Improved radio group flexibility with visual examples of image and icon-based selections.
- Introduced `Compliance` page with subsections for `Privacy` and `EU Compliance` settings. - Added configurable privacy fields, including policy display, admin access restriction, and data clear options. - Integrated EU compliance settings for vendor and customer fields, invoice overrides, and Germanized WooCommerce support. - Updated `Settings.stories` with hierarchical compliance features and detailed documentation links.
- Introduced `is_danger` prop to `SettingsElement` for rendering danger-specific styles. - Updated component classes to conditionally apply destructive styling based on `is_danger`. - Enhanced `Settings.stories` with danger examples using `TriangleAlert` icon and updated field labels. - Improved tooltip and description handling for danger-styled settings components.
- Updated `Settings` component to use `<RawHTML>` for titles in mobile and desktop views to allow HTML rendering. - Refactored hardcoded image URLs in `Settings.stories` to use a shared `image` variable for improved maintainability.
- Introduced `PreviewMulticheckField` for enhanced multicheck rendering with image and description support. - Added `vendor_info_preview` and `single_product_preview` field variants to `FieldRenderer`. - Updated `Settings.stories` with examples of preview fields, including tooltips and image URLs.
Summary by CodeRabbit
Release Notes
New Features
Documentation
Improvements