PagePlug Documentation

repository·open-v1.9.39·Indexed 24 days ago

https://github.com/cloudtogo/pageplug

A low-code development platform for professional developers to build web and mobile (WeChat Mini Program) applications. A localized and optimized version of Appsmith, PagePlug features high extensibility through JavaScript and seamless data integration. Documentation covers the Appsmith Design System, icon generation, Enterprise Edition (EE) overrides, and server-side ACL migration scripts.

Tokens
171.9K
Snippets
272
Records
1.1K
Agent score
81%

What's inside PagePlug

  1. What is PagePlug?

    open-v1.9.39
    PagePlug is an open-source, declarative, and visual low-code framework designed for developers (To D). It is a localized version of Appsmith optimized for the Chinese market. It allows developers to build web applications and WeChat Mini Programs by connecting directly to data sources like APIs and databases, turning backend data into JavaScript variables that can be used in any UI component.
  2. Key features of PagePlug

    open-v1.9.39

    PagePlug provides several core capabilities for rapid application development:

    • Visual Modeling Tool: Drag-and-drop components like tables, charts, forms, and buttons to create custom interfaces without heavy coding.
    • Extensive API Support: Seamless integration with third-party APIs for data storage, message queues, and file uploads.
    • Advanced Data Management: Built-in engine support for executing SQL queries and managing databases/tables without manual configuration.
    • High Extensibility: Supports writing custom JavaScript anywhere in the application and allows adding third-party JS libraries to control logic and customize components.
    • Security Features: Includes support for authentication, authorization, encryption, and auditing.
    • Mobile Support: Built-in support for creating WeChat Mini Programs quickly.
  3. Use the Appsmith Icons set for Entity Explorer Panel

    open-v1.9.39

    The appsmith-icons package provides a set of icons specifically designed for the Entity Explorer Panel. These icons serve as visual representations for various widgets, helping users identify components within the UI.

    Available icon components include:

    • ButtonIcon
    • CheckboxGroupIcon
    • CheckboxIcon
    • CurrencyInputIcon
    • HeadingIcon
    • IconButtonIcon
    • InlineButtonsIcon
    • InputIcon
    • KeyValueIcon
    • MenuButtonIcon
    • ModalIcon
    • ParagraphIcon
    • PhoneInputIcon
    • RadioGroupIcon
    • SectionIcon
    • StatsBoxIcon
    • SwitchGroupIcon
    • SwitchIcon
    • TableIcon
    • ToolbarButtonsIcon
    • ZoneIcon
  4. What is a Popover and how to use it

    open-v1.9.39

    A Popover is a page overlay triggered by a button that displays additional interactive content. It is best used for supplemental interactive content that contains at least one focusable element.

    Best Practices

    • Triggers: Popovers should be triggered by a button, icon, icon-button, or action-list.
    • Positioning: The popover should appear near its trigger element (above, below, left, or right) to maintain a visual connection.
    • Non-obstruction: Ensure the popover does not obstruct information on the page that is directly related to the popover content.
    • Scrolling: For long content, ensure the content area is scrollable. The header should remain sticky during scrolling to maintain context.

    When to use a Modal instead

    • Critical Information: Do not use popovers for critical information, warnings, or required inputs. Use a Modal for these scenarios.
    • Complex Workflows: Do not use a popover to guide users through complex, multi-step workflows. Use a Modal for workflows.
    • Primary Actions: Avoid placing more than one primary action within a single Popover.
  5. Select component variations

    open-v1.9.39

    The Select component supports several functional variations to suit different UI requirements:

    • Multiselect: Allows selecting multiple items from the list.
    • With checkboxes: A multiselect variation that includes checkboxes for each option.
    • Searchable: Enables users to filter the list of options by typing.
    • Disabled: Renders the component in a non-interactive state.
    • Loading: Displays a loading state within the component.
    • Validity: Shows the visual state of the field when it is in an invalid state (e.g., during form validation errors).
  6. Expose Widget Properties for data binding

    open-v1.9.39

    Widget developers can define which properties are exposed to Appsmith developers. These properties represent the state of the widget.

    Appsmith developers can then bind these properties to other entities using double curly braces {{ }}. This allows them to pass data into your widget or use your widget's state elsewhere. The platform evaluates the content within the braces, allowing for JavaScript manipulation.

    Example of binding an Input property to a Text widget: {{ Input1.text }}

    Example of using JavaScript within a binding: {{ Input1.text.toLowerCase() }}

  7. Popover Anatomy

    open-v1.9.39

    A Popover consists of the following structural elements:

    1. Popover panel: The main container for the popover content.
    2. Header: An optional section containing a title and/or a close icon.
    3. Title: An optional element in the header providing a brief label for the content.
    4. Close icon: An optional element that allows users to close the popover via click or by pressing the Esc key.
  8. Understand the Category Token naming convention

    open-v1.9.39

    Category tokens are mandatory for use throughout the platform and are structured to ensure consistency based on the component's category. The naming convention follows a specific hierarchical pattern to describe the token's purpose, scope, and visual properties.

    Naming Pattern: atom-category-component-kind-surface-state-presentational-attribute

    SegmentDescription
    AtomThe type of token (e.g., colors, spacing, typography).
    CategoryThe functional category (e.g., action, response, control, content).
    ComponentThe specific component (e.g., button, input, avatar). This is optional if the token is not component-specific.
    KindThe variant or importance level (e.g., primary, secondary, tertiary).
    SurfaceThe part of the component being styled (e.g., surface, label, icon).
    StateThe component state (e.g., default, hover, active).
    PresentationalAttributeThe visual property (e.g., bg, border, foreground).

    Example of a component-specific token: If the Avatar component requires unique colors for its background and border that differ from the general category, the tokens would be:

    • --ads-v2-colors-content-avatar-surface-default-bg
    • --ads-v2-colors-content-avatar-surface-default-border
    --ads-v2-colors-content-avatar-surface-default-bg
    --ads-v2-colors-content-avatar-surface-default-border
  9. Configure plugin UI with form.json and editor.json

    open-v1.9.39

    UI rendering for plugins is controlled by two JSON files located in src/main/resources:

    1. form.json: Defines the fields shown when a user creates a new datasource (e.g., credentials).
    2. editor.json: Defines the interface where users enter queries for execution.

    Use configProperty to map UI fields to the plugin's internal configuration object.

    # form.json
    {
      "form": [
        {
          "sectionName": "Details",
          "id": 1,
          "children": [
            {
              "label": "DB Username",
              "configProperty": "datasourceConfiguration.authentication.username",
              "controlType": "INPUT_TEXT",
              "isRequired": true,
              "placeholderText": "",
              "initialValue": ""
            }
          ]
        }
      ]
    }
    
    # editor.json
    {
      "editor": [
        {
          "sectionName": "",
          "id": 1,
          "children": [
            {
              "label": "",
              "configProperty": "actionConfiguration.body",
              "controlType": "QUERY_DYNAMIC_TEXT"
            }
          ]
        }
      ]
    }
  10. Use the List component for interactive actions

    open-v1.9.39

    The List component is used to display a set of interactive actions or choices in a uniform single-column layout. It is ideal for sidebars, navigation bars, or organizational lists where actions are directly accessible without additional user interaction (unlike a Menu component).

    Anatomy

    A List item typically consists of:

    1. Container: The wrapper for the item.
    2. Start icon: A visual indicator related to the action.
    3. Label: The primary text for the action item.
    4. End icon: An icon for more options or related actions.

    When to use List vs Menu

    • Use List when actions should be immediately visible and accessible (e.g., a sidebar navigation).
    • Use Menu when actions should be hidden behind a trigger (e.g., a click or hover) to manage complex sets of choices or hierarchical structures.
  11. Understand ZIndex design tokens

    open-v1.9.39
    The ZIndex design token provides numerical values used to manage the layering of UI elements. By using these tokens, you can control the visual hierarchy and ensure specific elements (like navigation menus or modals) appear on top of other content. These tokens are part of the theme system and are typically applied via CSS variables or theme properties.