Skip to content

Add AI feature toggles and summary UI#301

Open
arifulhoque7 wants to merge 329 commits into
weDevsOfficial:developfrom
arifulhoque7:feature/ai-settings-summary-pro-gate
Open

Add AI feature toggles and summary UI#301
arifulhoque7 wants to merge 329 commits into
weDevsOfficial:developfrom
arifulhoque7:feature/ai-settings-summary-pro-gate

Conversation

@arifulhoque7
Copy link
Copy Markdown
Contributor

@arifulhoque7 arifulhoque7 commented Mar 2, 2026

PR Description — Free plugin (wedocs)

Summary

Adds the AI Doc Summary settings section to the AI Control Settings panel. The section is gated behind a PRO upgrade overlay for free users. Includes a "Default Display Mode" option to force all docs into either Summary or Highlights mode.

What's new

  • Removed duplicate ai-summary endpoint from includes/API/API.php

    • The free plugin no longer registers GET /wp/v2/docs/{id}/ai-summary — this is PRO-only
  • AI Doc Summary settings section (AiSettings.js)

    • Enable/disable toggle (disabled when no API key or not PRO)
    • "Default Display Mode" radio buttons: Summary only (default) | Highlights only
    • Custom-styled radio buttons matching the indigo design system (no native OS controls)
    • PRO upgrade overlay on onMouseEnter when !isPro
  • Settings sanitization (includes/API/SettingsApi.php)

    • sanitize_ai_settings() now saves display_mode for ai_summaries
    • Validates against allowlist ['summary', 'highlights'], defaults to summary

Files changed

src/components/Settings/AiSettings.js   — added PRO overlay + display mode radio buttons
includes/API/API.php                     — removed ai-summary route + method (~80 lines)
includes/API/SettingsApi.php             — sanitize display_mode for ai_summaries

Related PRO PR
Close 171

Summary by CodeRabbit

  • New Features

    • Configurable AI summary display modes: Summary or Highlights-only
    • Provider and model selection for AI features
  • Improvements

    • PRO gating for premium AI capabilities with gated visuals and overlays
    • Server-side enforcement that disables Pro-only summary features when not on Pro
    • Improved API key handling with masking and clearer absence messaging
    • Streamlined AI settings UI for easier configuration and defaults handling

MdAsifHossainNadim and others added 30 commits November 6, 2023 17:08
weDevsOfficial#184)

* revert: move-wedocs-collapse-expand-settings-from-general-to-layout-panel

* enhance: implement-collapse-expande-prompts-settings-on-layout-prompts-page
…fficial#183)

* enhance: added-documentation-creation-delete-permission-for-permitted-users

* enhance: make-actions-for-collective-status-update

* enhance: add doc creation capabilities for all users & make creation reactive

* enhance: add-parent-documentation-creation-permission-for-all-users
* enhance: handle-draft-docs-permission-&-settings

* enhance: implement-switch-to-draft-action
…#178)

* enhance: add-edit-role-add-default-for-global-settings

* insert: add-editor-role-insertion-build-file
…eDevsOfficial#175)

* fix: documentation-archive-page-section-article-title-truncted-issue

* fix: merge-conflicts
* feat: implement-single-doc-page-searching-ui

* enhance: build-search-data-listing-&-ui

* enhance: check-single-doc-page-&-organized-codebase

* fix: search-clean-icon-size

* enhance: doc-search-popup-make-compatible-with-pro-version

* enhance: update-list-icon

* fix: search-box-ui-inconsistencies

* fix: alignment-&-search-form-css-fixes
)

* enhance: organized-plugin-assets

* fix: media-overloading-issue

* fix: remove-multiple-localized-scripts-&-fix-dynamic-url-redirection-issue

* fix: spacing-issue-on-assets-enqueue
* fix: single-doc-page-search-filter-ui-stuff

* enhance: update-search-popup-ui-&-make-scalable-with-pro

* enhance: update-search-color-panels-js-implementation

* fix: remove-redunded-codes
…fficial#186)

* fix: single-doc-page-search-filter-ui-stuff

* fix: n0-releasing-content-inconsistencies

* fix: n0-releasing-explore-&-doc-search-inconsistencies

* fix: single-doc-page-search-filter-ui-stuff

* fix: single-doc-page-search-filter-ui-stuff

* fix: translation-stuff

* fix: translation-stuff-&-update-readme-changelog-version-stuff
…icial#187)

* enhance: handle-ui-loading-inconsistencies-stuff

* enhance: optimize-docs-fetching-request-&-separate-parent-section-listing-page-request

* enhance: remove-set-loadings-from-resolvers

* enhance: update-plugin-screenshot-&-upgrader-plugin-version
)

* fix: revamp-docs-delete-api-&-fix-deletion-permission-error

* fix: migrated-docs-reactivity-issue

* revert: remove-redunded-codes
…l#188)

* enhance: add-article-children-list-in-docs-listing-page

* enhance: add-draggable-option-for-article-children

* enhance: add-wedocs-content-extraction-function-&-update-children-getter-function

* release: add-releasing-logs-for-version-2-1-2
arifulhoque7 and others added 20 commits March 3, 2026 12:35
* feat: Integrate search form with modal functionality

- Convert doc-search-form.php from form submission to modal-based search
- Remove Button Style and Button Size controls from PrintButton block
- Fix JavaScript null reference errors in frontend.js
- Enable search modal functionality on all pages (not just single docs)
- Add defensive programming to prevent querySelector errors
- Maintain original design while enabling quick search functionality
- Fix CSS positioning to keep search icon on right side

Changes:
- templates/doc-search-form.php: Added modal integration with CSS fixes
- assets/js/frontend.js: Fixed null reference errors and enabled modal on all pages
- includes/Frontend.php: Set isSingleDoc to true for universal modal access
- PrintButton block: Removed buttonStyle and buttonSize attributes and controls

* Apply suggestion from @coderabbitai[bot]

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Apply suggestion from @coderabbitai[bot]

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Iftakharul Islam Ifat <88052038+iftakharul-islam@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Preserve AI integration flag when saving settings

When updating wedocs_settings, preserve the existing integrate_ai value if the incoming payload omits or clears it. The code reads the current option and copies integrate_ai into the filtered settings when present, preventing accidental clearing of the AI connection state during general settings updates.

* Preserve integrate_ai on settings save

Use array_key_exists when merging integrate_ai from existing wedocs_settings into the new payload. The previous !empty check could drop explicit falsy values (e.g. false or 0); the new condition preserves the existing integrate_ai value when the key exists in the stored settings but is absent from the incoming settings_data_filtered.
Update plugin/package version to 2.2.0 across package.json, package-lock.json, wedocs.php and readme.txt (Stable tag and VERSION constant). Add v2.2.0 changelog entries covering new features (search modal, responsive sidebar, legacy theme option, shortcode pagination) and bug/security fixes. Regenerate package-lock.json to reflect dependency metadata changes.
Add the missing closing curly brace and </style> tag to templates/doc-search-form.php to properly terminate the inline CSS block. This prevents broken markup/CSS leakage and fixes the search form layout.
* Fix: tailwind something-[xyz] not working

* Update postcss.config.js

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Add AI image analysis support with vision models

Introduces image upload, deletion, and analysis endpoints to the API for AI Doc Writer, including backend image processing, validation, and cleanup. Updates AI provider configs to include vision capability metadata for models, adds UI and settings support for enabling image analysis, and integrates image payload handling in the AI Doc Writer modal and service. Also implements scheduled cleanup of temporary images and ensures compatibility with Pro features and extensibility via hooks and filters.

* Add AI image analysis pro feature preview

Introduces the AiImageAnalysisPreview component to display a pro feature preview for AI image analysis in the settings. The preview is shown when the pro version is not loaded, informing users about the feature and its impact on API token usage.

* Apply suggestion from @coderabbitai[bot]

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Improve AI image upload/analysis and security

Refactor AI image handling to use WP attachments, strengthen validation and security, and add configurable max upload size.

- Validate and sanitize the images request param (accepts IDs or objects), with detailed validation callbacks.
- upload_temp_image now stores uploads in the WP media library (media_handle_upload), uses finfo/wp_check_filetype_and_ext/getimagesize to validate MIME and content, enforces image dimension limits, and marks attachments as temporary via post meta.
- Remove legacy temp-file endpoint/flow and temp-dir cleanup code; scheduled cleanup functions were removed in favor of using attachment metadata.
- Add pro-feature checks for image analysis and permission checks to ensure user can access attachments.
- Replace filename-based helpers with attachment-based helpers: get_image_base64() and get_image_media_type() now operate on attachment IDs and re-validate file contents.
- Sanitize AI-generated HTML output with wp_kses and whitelist allowed tags/attributes.
- Settings: add image_analysis.max_size (KB) sanitization and limits (100KB–5120KB) in SettingsApi; add UI in AiSettings.js to configure max_size with frontend bounds and display.

These changes eliminate ad-hoc temp file handling, improve security against malformed or malicious uploads, and make maximum upload size configurable.

* Harden uploads and sanitize AI settings

Improve file upload security by normalizing MIME types, using finfo to detect real MIME, and cross-validating against an allowlist; update error messaging and always prefix uploaded filenames with a unique ID to avoid conflicts. Add temperature to AI request payload. Replace direct ai settings localization with wedocs_get_ai_settings_for_frontend(), which strips sensitive fields (API keys/secrets) and exposes a has_api_key flag per provider. Also remove registration of the deactivation hook for AI cleanup cron.

* feat: add pro preview for screenshots section in AI Doc Writer modal

Adds a locked pro preview of the image upload (Screenshots) section
inside the AI Doc Writer block editor modal for free users.

- Add AiDocWriterImageUploadPreview component with a disabled drop zone,
  PRO badge, and hover tooltip matching the backend UpgradeTooltip design
  (features list, green checkmarks, indigo upgrade button) using inline
  styles to work correctly in the block editor context where Tailwind
  is not loaded
- Add src/editor/ProPreviews.js as a generic entry point for all block
  editor pro preview filters, replacing the feature-specific
  AiDocWriterProPreview.js
- Register the preview via the wedocs_ai_doc_writer_modal_fields filter
  (priority 5); bypassed automatically when Pro plugin is active via
  wedocs_pro_loaded filter check
- Import ProPreviews from the editor bundle entry point (src/editor/index.js)

* Add dynamic AI model listing & cleanup job

Add a REST endpoint to fetch provider model lists (/ai/models/{provider}) and implement provider-specific fetchers (OpenAI, Anthropic, Google). Results are normalized, cached in a transient for one hour, and fall back to the static config when no API key is present or the remote call fails. Add helpers to normalize static models and pattern-based vision detection plus use cached dynamic lists when available. Improve MIME detection by using the finfo class, harden attachment metadata reads, and tweak AI settings sanitization. Update provider model IDs/names in static configs. Frontend: fetch live model lists from the new endpoint, show loading state, add a refresh button and spinner, and wire apiFetch. Schedule a daily WP-Cron to remove temporary AI image attachments on activation and clear the hook on deactivation; implement the cleanup routine. Misc: avoid repeated option reads when preparing frontend AI settings.

* Remove AI temp image cleanup and scheduling

Remove the wedocs_cleanup_ai_temp_images handler and its cron scheduling. The cleanup function and its add_action were deleted from includes/API/API.php, and related scheduling logic (activation scheduling, deactivation hook and deactivate method) were removed from wedocs.php. This stops the plugin from scheduling or running the daily WP-Cron job that deleted temporary AI-generated attachments.

* Remove temporary metadata on attachments

Stop setting _wedocs_ai_temp and _wedocs_ai_temp_created post meta when creating attachments in the API. These lines previously marked attachments as temporary for cleanup; removing them prevents attachments from being incorrectly flagged as temporary and defers cleanup handling to other logic.

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* block rendering in the editor

* colors in preview

* cleanup

* set default padding

* proper link

* add drop shadow support

* preview and block icon added

* initial setup

* quick search input field stylings

* initial frontend modal rendering

* feat: Add Print Button block

* initial search response

* frontend search better UX

* frontend UX improvement

* fix: change color UI default block

* fix: frontend design

* search modal styling

* Modal Docs Source implementation

* section, article checking for predefined docs

* added show icon option

* cs fixes

* alignment option added

* block editor settings added

* fix : coderabbit issues

* feat: doc navigation block

* Added Helpful feedback

* color and hover color fixes for multi-level links

* support for menu_order = 0

* Add contributor

* fix: unused design

* enhance: image in quick search result

* Showing multiple authors

* WIP

* enhance: drop shadow on doc nav block

* custom shadow option added

* better UX

* WIP

* initial sidebar block settings

* section box styling

* update block settings

* enhance Sections Order By

* enhance: Sections Order By name

* enhance: article order by

* Configured wedocs new package system

* frontend rendering with styles

* cleanup

* TOC block added

* TOC generation issue fix.

* fix: conflict with existing quick search

* Latest Build Added

* WIP

* Old meta value connected

* wp/script version 30

* remove build folder

* align DocsGrid, QuickSearch blocks

* initial template

* template wip

* tweaks, error handlings

* fixed undefined error

* Fixed: deprecated errors

* fixed allignment

* WIP

* Add Helpful Feedback block for articles

Introduces a new 'Helpful Feedback' block with customizable voting buttons, styling options, and server-side rendering for docs articles. Updates Contributors block to restrict rendering to docs post type and registers the new block in the main index.

* Update color controls to use 'wedocs' text domain

Replaced all instances of the 'block-responsive' text domain with 'wedocs' in ColorsControls.js for consistency with the plugin's localization. Also fixed a variable reference in ListItems.js to use attributes.containerBackgroundColor directly.

* remove old lock file

* use wp-script v30 to render blocks

* Prevent direct access

* Added Social Share Block

* Add AI Summary and Doc Actions blocks, enhance styling

Introduces a new AI-Powered Summary block with collapsible functionality, custom icons, and extensive style controls. Adds a new Doc Actions block (initial files). Refactors Contributors block to use shared style panels and improves InspectorControls organization. Updates block.json files for better support of color, spacing, and typography options. Adds a common controls utility for Inspector panels.

* Added Font Switcher Block

* Update view.js

* Fix AI summary bLock

* Fix FontSizeSwitcher Block

* add build files

* align .gitignore with develop

* remove nested `weDocs`

* Bump dependencies & update lockfile

Update package.json to bump @wordpress/scripts and regenerate package-lock.json. The lockfile was updated after installing new versions (including @wordpress/scripts ^30.25.0), adds copy-webpack-plugin, and includes many dependency version upgrades (notably multiple @babel/* packages) and accompanying metadata fixes. Regenerated lockfile to lock the upgraded dependency tree.

* Update wedocs category

* update Sidebar docs render on single docs

* docs grid pagination added

* sidebar doc render updated to single

* Sidebar: scope fetched docs to current post tree

When editing a docs post, fetch the current post from selectors and determine its topmost ancestor via a new findRootParent helper (walks parents using wp.apiFetch). Use that root ID to filter REST API results to only the docs within the current section tree before building the hierarchical sections. Also add currentPost.id to the effect dependencies so the data refreshes when switching posts.

* Removed helpful block top note block name

* Updated single block tempalte

* Update HelpfulModal AJAX payload and render output

Add localized AJAX data to the server-rendered HelpfulModal (needMoreHelpAjax with ajaxUrl and nonce) and guard it with WEDOCS_NEED_MORE_HELP_AJAX_LOCALIZED to avoid duplicate output. Update the frontend view to use the backend's expected AJAX action and payload keys: action changed to wedocs_contact_feedback, subject default set to "Need More Help", send doc_id instead of page_url, and use _ajax_nonce. Also includes small PHP whitespace/indentation cleanups.

* Update controls

* Removed build

* WIP

* Reset DB templates missing required blocks

Add a required_blocks list and maybe_reset_db_template() to detect and delete DB-stored wp_template posts that are missing required wedocs blocks so the plugin's file-based template takes precedence. The check runs once per plugin version (stored in an option). Also add get_db_template() helper and reuse the template file contents when registering block templates. Minor docblock update: QuickSearch AJAX @SInCE changed to 2.2.0.

* DocsGrid: tidy render, settings and styles

Remove text color control from block.json and simplify experimental default controls. Improve render.php by normalizing whitespace/formatting, fixing current page detection for front-page pagination, wrapping output with get_block_wrapper_attributes, adding paginate_links 'type' => 'list', and cleaning up markup/indentation (SVG attributes, anchor/style spacing, section/article HTML). Use CSS gap variable in style.scss (var(--wp--style--block-gap, 1.5rem)) for theme-consistent spacing.

* Add per-element typography controls

Introduce per-element typography support for the DocsGrid block. Adds a reusable TypographyGroup component using native FSE/Gutenberg controls (FontSizePicker, FontFamily, LineHeight, FontAppearance) that reads theme font sizes/families via useSettings, and wire up Title, Button and Pagination typography panels in the block inspector. Adds corresponding attributes to block.json (fontSize, fontWeight, fontFamily, lineHeight for title/button/pagination), applies those attributes in edit.js for the editor preview, and outputs CSS vars / inline styles in render.php for the frontend. Update style.scss to consume the new pagination CSS variables. Overall enables theme-aware, per-element typography configuration.

* Add advanced typography controls to DocsGrid

Replace the old typography PanelBody/VStack with the native ToolsPanel/ToolsPanelItem pattern and add additional typography controls (letter-spacing, text-decoration, text-transform) to the DocsGrid block. Introduces a keys map and helper setters/resetters in StyleControls.js, wires new attributes in block.json, updates edit.js to apply the new attributes to inline styles, updates render.php to emit corresponding CSS variables, and uses those variables in style.scss for pagination. These changes make the block's typography UI match the FSE editor pattern and enable more granular styling for title, button, and pagination elements.

* Add system font fallback to Typography control

Introduce a SYSTEM_FONTS constant and prefer theme-provided typography.fontFamilies; when none are registered, fall back to a curated list of system/web-safe fonts so the FontFamily control remains usable. Rename the second useSettings return to themeFontFamilies for clarity and default the FontFamily panel to shown (isShownByDefault). Add explanatory comments.

* Add inline layout option to HelpfulFeedback

Introduce a new boolean attribute inlineLayout (default false) to the HelpfulFeedback block to allow displaying the question and buttons in a single row. Editor: add a ToggleControl to edit.js that sets inlineLayout and update the block wrapper class to include "inline-layout" when enabled. Server: read inlineLayout in render.php and add the inline-layout CSS class to the output. Styles: add SCSS rules to style.scss to arrange title and buttons inline with alignment handling and responsive tweaks. This provides a compact inline presentation option while keeping existing layouts intact.

* Add truncate and collapse options to Breadcrumb

Introduce truncation and collapsing behavior for the Breadcrumb block. Added new block attributes (truncateTitle, maxTitleLength, collapseBreadcrumbs, maxVisibleItems) with defaults in block.json, new Range/Toggles in the Inspector to control them, and UI state in edit.js to preview truncation and collapsed middle items (including an expandable collapsed indicator). Server render (render.php) now respects these attributes: it collapses long breadcrumb trails into an ellipsis item and truncates long titles server-side via helper functions, and includes accessibility/title attributes for links and collapsed indicators.

* HelpfulModal: add layout & button trigger

Introduce layout and trigger button options for the HelpfulModal block. Adds new attributes (layout, triggerStyle, triggerButtonBgColor, triggerButtonTextColor, triggerButtonBorderRadius, triggerButtonPadding) and Inspector controls (layout and trigger ToggleGroup, color palettes, border radius, padding) in the editor for configuring stacked vs row layout and link vs button triggers. Editor preview logic now adapts styles and markup for row/staked modes and button styling. Server-side render.php updated to respect the new attributes (builds inline styles, outputs icon circle/SVG for row layout, and conditionally outputs button classes/styles). Added SCSS for .layout-row and .trigger-button interactions. These changes enable consistent editor preview and front-end rendering for the new layout and trigger styling options.

* fixed: Print button block

* Support text-only Social Share buttons

Introduce a new "text-only" variant for SocialShare buttons. edit.js: add conditional class, adjust inline styles for transparent background and color, and hide icons in the editor when buttonStyle is 'text-only'. render.php: output the new class and inline style for front-end links to render transparent background and use platform color for text when text-only. style.scss: add .wedocs-social-btn-text-only rules to remove background/border/shadow and tweak padding and hover. wedocs.php: comment out the AdvanceContributors block directory to disable its build inclusion.

* Group style controls and refactor date formatter

Reorganize the LastUpdated block inspector UI by closing the main InspectorControls earlier and introducing a separate InspectorControls group="styles" for color and typography settings; remove the padding and margin SpacingPanel entries. In render.php, add a function_exists guard around wedocs_format_last_updated_date to avoid redeclaration and refactor the switch into a PHP 8 match expression for more concise date-format handling (including the 'relative' human_time_diff case).

* DocActions: default text color & text-button

Change default textColor to #1e1e1e and prevent text-style buttons from rendering borders/shadows. Inline styles in edit/save now only include border properties when buttonStyle !== 'text', and .style-text rules were strengthened with !important for border, background, and box-shadow to ensure text buttons remain visually plain.

* Reorganize InspectorControls and contributors

Reorganize block inspector UI and improve contributors/block rendering.

- Move style-related panels into InspectorControls group="styles" for AISummary and SocialShare to better separate style controls.
- AdvanceContributors: remove the deprecated 'rounded' avatar option from block.json and simplify avatar radius handling in the editor (circle vs square). Add new editor controls: avatar link behavior (with custom URL), contributor gap, enableSchema toggle, and additional CSS classes; remove duplicated Advanced panel.
- AdvanceContributors render: make border parsing more robust (support unified border object, per-side format, and legacy keys), support both array and string borderRadius formats, and simplify avatar shape output.
- Contributors render: use get_block_wrapper_attributes to build wrapper with classes and inline styles for improved block support integration.

These changes improve editor UX, add configurable contributor options, and make front-end style parsing more resilient to different control formats.

* Group InspectorControls for style panels

Refactor block inspector markup to separate style controls into a dedicated InspectorControls group. Close the primary InspectorControls earlier and add InspectorControls group="styles" wrappers around ColorSettingsPanel / style-related ToolsPanel in DocActions, FontSizeSwitcher, HelpfulModal, PrintButton, and ReadingProgress so style settings are grouped separately from advanced/display panels. This organizes the editor UI and prevents nested/incorrect InspectorControls blocks.

---------

Co-authored-by: arifulhoque7 <hoquea57@gmail.com>
Co-authored-by: Iftakharul Islam Ifat <88052038+iftakharul-islam@users.noreply.github.com>
Update Contributors block config to use an 8px default for avatarBorderRadius instead of 50%. This changes avatars from fully circular to slightly rounded rectangles to better match the current design language and spacing.
Update Contributors block to set avatarBorderRadius when avatarShape changes. The onChange handler now applies defaults ({ circle: '50%', rounded: '8px', square: '0' }) so selecting a shape also updates the border radius to maintain consistent avatar appearance.
Replace the legacy avatarShape attribute with a direct avatarBorderRadius value in both the block editor and server render. The editor now stores explicit radius values (50%, 8px, 0) via the SelectControl and applies avatarBorderRadius to avatar styles; redundant shape-to-radius mapping and avatarShape handling were removed. The PHP render now reads avatarBorderRadius (defaulting to 50%) when building avatar styles. Also removed radius callbacks/props from the border control usage to avoid duplicate state.
…ors-avatar-rounded-border-radius

Change default avatar border radius to 8px
* Bump version to 2.2.1 and update changelog

* Bump package version to 2.2.1

Update version from 2.2.0 to 2.2.1 in package.json and package-lock.json to publish a patch release.

* Changelog: simplify v2.2.1 entries

Remove the AI image analysis (Pro) addition and shorten/reword two fix entries in the v2.2.1 changelog to eliminate extra details and streamline the release notes.

* Build: compile and add updated block assets

Regenerate and add compiled block assets for multiple blocks. Adds new built files (CSS, JS, asset manifests, fonts, images) under assets/build for blocks such as AISummary, Breadcrumb, Contributors, DocActions, DocNavigation, DocsGrid, FontSizeSwitcher, HelpfulFeedback/Modal, LastUpdated, PrintButton, QuickSearch, ReadingProgress, Search, Sidebar, SocialShare, TableOfContents and helper utilities. Updates block.asset.php dependencies (adds react, wp-api-fetch, wp-core-data, wp-data), updates frontend/editor/store/print assets and icons, removes/renames some RTL files, and includes new block styles. Also includes source updates across src/blocks, tweaks to includes (Ajax.php, Assets.php, Frontend.php), webpack.config.js, languages/wedocs.pot and main plugin file (wedocs.php). Intended to ship the latest built output and corresponding source changes.

* Update HelpfulFeedback & HelpfulModal blocks and build

Update source and compiled assets for HelpfulFeedback and HelpfulModal blocks (block.json, edit.js, render.php, styles), refresh Contributors render, and bump built asset version. Also update helpful-feedback.js, includes/Ajax.php and language POT to reflect changes. Compiled files in assets/build were regenerated to include these updates.

* Refactor feedback UI to use full-width messages

Replace the previous thank-you DOM insertion with a new showFullMessage helper that hides existing controls and displays a centered, full-width message (styled red for already-voted). Adjust handleVoteSuccess to mark the container as voted before showing the message and use showFullMessage for both thank-you and already-voted cases. Simplify showError to directly append a styled error block. Also update the POT file timestamp.

* Add font-size to helpful feedback message

Add inline font-size: 14px to the .wedocs-feedback-full-message element in assets/js/helpful-feedback.js to ensure the feedback text remains readable and consistent across themes. This is a presentational change only and does not alter functional behavior.

* Validate post ID is numeric in capability

Add an is_numeric() check for $_GET['post'] before converting with absint() and calling get_post_type(). This prevents non-numeric values from being passed through the capability gate, avoiding potential warnings or unexpected behavior and ensuring the early return still happens for missing, non-numeric, or non-"docs" posts.

* Use block_categories_all filter; remove duplicate

Replace add_action with add_filter for the 'block_categories_all' hook so the class method correctly registers the block category. Remove the standalone anonymous filter that previously added the 'wedocs' category to avoid duplicate registrations and redundant code.

* Expand padding and margin into individual props

Update Contributors block Edit component to set padding and margin using individual CSS properties (paddingTop, paddingRight, paddingBottom, paddingLeft and marginTop, marginRight, marginBottom, marginLeft) instead of a single shorthand string. This makes each side's value apply reliably (including undefined/null or numeric attribute values) and improves robustness when attributes are objects rather than preformatted strings. No other behavior changes in this file.

* Use post_author and dedupe contributors

Fix Contributors block rendering: use the post_author field for main_author mode and add existence checks for get_userdata. Aggregate contributor IDs from the wedocs_contributors meta, include the post author and revision authors, skip empty IDs, and avoid duplicates so only valid, unique user objects are added to the contributors list.

* Use ColorPalette for color controls

Replace usage of PanelColorSettings with individual ColorPalette components and add import. Reorganize color UI: rename 'Style Settings' panel to 'Color Settings', split text/background and hover color pickers into separate PanelBody sections, add explicit labels for each color picker, and switch the border color picker to ColorPalette. Also move the Inspector component invocation outside of InspectorControls and apply minor whitespace cleanup.

* Remove height: 100% from HelpfulModal styles

Delete the hard-coded `height: 100%` rule from the HelpfulModal SCSS so the modal can size itself based on content and the existing flex layout. This avoids forcing full-height behavior that can cause layout and overflow issues.

* Add block examples, AISummary borders, hover color

Add example presets for multiple blocks to improve editor previews and defaults. Enhance AISummary with borderStyle, borderWidth and borderColor attributes, render/save support and a BorderPanel in the editor. Add hoverTextColor support to DocActions (data attribute, editor control and runtime hover behavior that restores original text color). Breadcrumb block: add font-size handling in editor and render, and wrap output with get_block_wrapper_attributes. Remove the HelpfulFeedback editor preview note and related styles, and remove the HelpfulModal editor pseudo-element. Update localization POT metadata and add a few new UI strings.

* DocNavigation: support WP text color & style fixes

Expose text color support in block.json and tidy up editor preview and server render styles. In edit.js merge the block className, remove the click/selectBlock handler from the preview, and set navigation item default textDecoration to none. In render.php prefer the WP color preset (var(--wp--preset--color--*)) when present, apply !important to navigation and arrow colors, move the navigation style onto the anchor (removing redundant span color) and simplify the hover selector so hover color applies correctly. These changes ensure the block respects WordPress color presets and produces more consistent styling between editor preview and front-end.

* update discount

* updated FSE template

* template updated

* update latest template

* Remove theme attribute from template parts

Remove the hardcoded "theme":"twentytwentyfive" attribute from the header and footer template-part blocks in templates/block-templates/single-docs.html to make the template parts theme-agnostic and improve portability. No other content changes were made.

* Remove column border styles in single-docs

Remove border-related attributes and classes from the left, center, and right column blocks in templates/block-templates/single-docs.html. The change deletes the `has-border-color has-base-border-color` classes and `border-width` styles on the column wrappers so they no longer render 1px borders, simplifying the layout and avoiding redundant borders. Internal block borders (e.g. quick-search, table-of-contents) are left intact.

* Update changelog entry for v2.2.1

Update v2.2.1 changelog: change release date to 30 Mar 2026 and reword the Added item from "article page template" to "single page doc template" for the Full Site Editor (ref weDevsOfficial#295). Also remove the Contributors block avatar shape fix entry (weDevsOfficial#305).

---------

Co-authored-by: Iftakharul Islam Ifat <88052038+iftakharul-islam@users.noreply.github.com>
Refresh the translation template: update POT-Creation-Date and refresh source references/line numbers across the file. Add references for the new AISummary block, remove a few obsolete msgids (e.g. weDocs Blocks, Preview mode - voting disabled in editor, Style Settings), and sync msgctxt locations to match recent code changes.
Replace the ESM import and createRequire usage with a CommonJS require destructuring to import scopedPreflightStyles and isolateInsideOfContainer from 'tailwindcss-scoped-preflight'. No functional changes to rootClass; this simplifies the import and removes the need for createRequire.
@arifulhoque7 arifulhoque7 force-pushed the feature/ai-settings-summary-pro-gate branch from 0e9f3b9 to 2246f3f Compare May 28, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.