@bigbinary/neeto-themes-frontend

中文文档
4.2.3发布于 2026/11/02UNLICENSEDTypeScriptESM + CJS近 30 天下载 1.2万

A repo acts as the source of truth for the new nano's structure, configs, data etc.

原始使用文档
文档目录9 节
  1. Contents
  2. Development with Host Application
  3. Engine
  4. Usage
  5. Frontend package
  6. Instructions for development
  7. Usage
  8. Custom CSS
  9. Instructions for Publishing

neeto-themes-nano

The neeto-themes-nano allows us to build and use themes within neeto applications. This nano exports @bigbinary/neeto-themes-frontend NPM package and neeto-themes-engine Rails engine.

Contents

  1. Development with Host Application
  2. Instructions for Publishing

Development with Host Application

Engine

Installation

  1. Add this line to your application's Gemfile:

     source "NEETO_GEM_SERVER_URL" do
       # ..existing gems
    
       gem 'neeto-themes-engine'
     end
    
  2. And then execute:

    bundle install
    
  3. Add this line to your application's config/routes.rb file

     mount NeetoThemesEngine::Engine, at: "/neeto_themes"
    
  4. Add required migrations in the db/migrate folder. Run the following commands to copy the migrations from the engine to the host application.

    bundle exec rails neeto_themes_engine:install:migrations
    bundle exec rails db:migrate
    
  5. Add the following line to models/organization.rb file.

    has_many :themes, class_name: "NeetoThemesEngine::Theme", as: :owner
    
  6. Configure model to add below association to attach theme.

    has_one :theme_entity, as: :themeable, class_name: "NeetoThemesEngine::ThemeEntity", dependent: :destroy
    has_one :theme, through: :theme_entity, class_name: "NeetoThemesEngine::Theme"
    

Usage

  1. Create an engine initializer

    Create a file named neeto_themes_engine.rb in the config/initializers folder.

  2. Customize theme schema

    The engine supports customizing theme schemas based on the needs of the host application. This schema will be used in the frontend to render the theme properties. Eg:

     NeetoThemesEngine.theme_properties_schema = [
       { kind: "color", key: "primary_color", default_value: "#2D36D4" },
       { kind: "color", key: "secondary_color", default_value: "#ECF4FF" },
     ]
    

    Each object in the array should have the following keys:

    • key: The unique identifier for the theme property.

    • kind: The kind of the theme property.

    Optional keys that can be included:

    • default_value: Sets a default value when creating a new theme.

    • hidden: This boolean prop helps to hide the property from the UI but allows to use it as CSS variable.

    • depends_on: Provides a dependency on other properties. If a key is provided, it will check for its value and only appear in the UI if the dependent property is present.

    • parent_class: This key needs to be added for custom css feature to work properly. See more on custom css feature.

    • use_default_image_size: Used to apply defaultImageSize prop passed to ImageUploader component.

    • default_image_size: Used to pass defaultImageSize prop passed to ImageUploader component. Should be an object with width and height properties.

    • fixed_aspect_ratio: Used to pass fixedAspectRatio prop passed to ImageUploader component. Should be an object with width and height properties.

    • max_image_size_in_mb: Maximum size of the uploaded image in MB for an image kind property. Accepts decimals, eg: 0.1. Defaults to 1.

  3. Provide a css variable prefix

    This value will be used to prefix all CSS variables. Eg:

      NeetoThemesEngine.css_variable_prefix = "neeto-cal"
    

    variable generated for the theme property primary_color will be --neeto-cal-primary-color.

  4. Provide the entities to which the theme property is attached

    This value will be used to determine the entity to which the theme property is attached. We can provide multiple entities. Eg:

      NeetoThemesEngine.valid_themeable_types = ["Meeting", "Booking"]
    
  5. Provide a default theme name (Optional)

    This provided value will be used to identify the default theme. If not provided, the default theme will be named "Plain blue".

      NeetoThemesEngine.default_theme_name = "My theme"
    

Frontend package

Installation

  1. Add the neeto-themes-frontend package to the package.json

    yarn add @bigbinary/neeto-themes-frontend
    

Instructions for development

Check the Frontend package development guide for step-by-step instructions to develop the frontend package.

Usage

Components

  1. Import the NeetoThemesBuilder component from @bigbinary/neeto-themes-frontend:

    import React from "react";
    import { NeetoThemesBuilder } from "@bigbinary/neeto-themes-frontend";
    
    const App = () => (
      <NeetoThemesBuilder
        entityId={meeting?.id}
        entityType="Meeting"
        thumbnail={Thumbnail}
      >
        <Preview />
      </NeetoThemesBuilder>
    );
    
    export default App;
    

    Props:

    • entityId (required): The ID of the entity to which the theme is attached.
    • entityType (required): The type of the entity (e.g., "Meeting", "Booking").
    • thumbnail (required): A React component to display as the theme thumbnail.
    • children (required): The preview component to render.
    • onPropertiesChange (optional): Callback function triggered when theme properties change.
    • defaultImageSize (optional): Default image size for image uploads. Should be an object with width and height properties.
    • fixedAspectRatio (optional): Fixed aspect ratio for image uploads. Should be an object with width and height properties.
    • helpDocUrl (optional): URL to the help documentation.
    • isTemplateThemesEnabled (optional): Boolean to enable template themes feature. Default: false.
    • pageTitle (optional): Custom page title for the theme builder.
    • onApplyThemeSuccess (optional): Callback function triggered when a theme is successfully applied.
    • onUpdateThemeSuccess (optional): Callback function triggered when a theme is successfully updated.
    • onApplyGlobalThemeSuccess (optional): Callback function triggered when a global theme is successfully applied.
    • helpPopoverProps (optional): Props to pass to the help popover component.
    • enabledFeatures (optional): Object to control which features are enabled. Default: { customCSS: true }. Set { customCSS: false } to disable the Custom CSS feature.
    • proFeatures (optional): Object to specify which features should be marked as "pro" features. Example: { customCSS: true } will mark Custom CSS as a pro feature.

hooks

  1. Import useThemeUtils hook from "@bigbinary/neeto-themes-frontend"

    import { useThemeUtils } from "@bigbinary/neeto-themes-frontend";
    
    const { setTheme, previewingTheme, currentTheme } = useThemeUtils();
    
  • setTheme: This method is used to set the theme for the entity.

  • previewingTheme: This object contains the currently previewing theme.

  • currentTheme: This object contains the current theme which is applied to the entity.

Custom CSS

neeto-themes-nano will inject custom css into your application as part of a theme. You can provide enabledFeatures={{ customCSS: false }} in NeetoThemesBuilder to manually hide the CustomCSS feature. You can pair it with proFeatures={{ customCSS: true }} to show it disabled in non-enabled cases.

This feature requires the initializer to be set with the additional property { kind: "custom_css", key: "custom_css", default_value: "", parent_class: "neeto-form-eui" }. The parent_class key will be used as a parent to inject styles and for CSS nesting. This ensures that styles are not injected on pages where you do not want it and also ensures that style rules targeting elements outside this class will not be applied. Please ensure that the value provided toparent_classis present in your application as a wrapper CSS class. For example:neeto-form-eui in neetoForm is present in all external pages where theme needs to be applied. . It also provides a code editor with syntax highlighting which depends on Monaco editor as a peer dependency. Please install it in the host application for proper working.

Instructions for Publishing

TBD

Consult the building and releasing packages guide for details on how to publish.

版本与发布记录

@bigbinary/neeto-themes-frontend 共发布 158 个版本,首次发布于 2024/05/07;过去 12 个月发布了 71 个版本。

版本发布日期距今
4.2.3latest2026/11/026 天前
4.2.22026/11/026 天前
4.2.2-beta1beta2026/11/026 天前
4.2.12026/11/017 天前
4.2.1-beta12026/11/017 天前
4.2.02026/10/317 天前

关于 @bigbinary/neeto-themes-frontend 的常见问题

@bigbinary/neeto-themes-frontend 是什么?

A repo acts as the source of truth for the new nano's structure, configs, data etc.

如何安装 @bigbinary/neeto-themes-frontend?

在项目目录运行 npm install @bigbinary/neeto-themes-frontend,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:qs(6.16.2)、url(0.11.4)、yup(0.32.11)、antd(5.22.1)、util(^0.12.5)、axios(1.20.0)、ramda(0.29.0)、react(18.3.1)、buffer(^6.0.3)、formik(2.4.6)、i18next(22.5.1)、zustand(4.4.2)、dompurify(3.4.17)、js-logger(1.6.1)、react-dom(18.3.1)、classnames(2.5.1)、stream-http(3.2.0)、tailwindcss(4.1.17)、lucide-react(^0.577.0)、react-helmet(^6.1.0)、os-browserify(0.3.0)、react-i18next(12.3.1)、vm-browserify(1.1.2)、@babel/runtime(7.29.7)、react-toastify(8.0.2)、tty-browserify(0.0.1)、path-browserify(^1.0.1)、https-browserify(1.0.0)、mixpanel-browser(2.45.0)、react-router-dom(5.3.3)、crypto-browserify(3.12.1)、source-map-loader(4.0.1)、stream-browserify(^3.0.0)、@bigbinary/neetoui(8.8.3)、@honeybadger-io/js(6.10.1)、@monaco-editor/react(4.6.0)、@bigbinary/neeto-cist(1.0.17)、@honeybadger-io/react(6.1.25)、@tanstack/react-query(5.59.20)、@bigbinary/neeto-atoms(1.1.2)、@bigbinary/neeto-icons(1.20.89)、@bigbinary/neeto-molecules(5.9.13)、@tailwindcss/container-queries(0.1.1)、@tanstack/react-query-devtools(5.59.20)、@bigbinary/neeto-commons-frontend(4.14.8)、@bigbinary/neeto-filters-frontend(4.6.3)、@bigbinary/neeto-image-uploader-frontend(4.1.14)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@bigbinary/neeto-themes-frontend 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@bigbinary/neeto-themes-frontend 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@bigbinary/neeto-themes-frontend 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.13。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@bigbinary/neeto-themes-frontend 可以商用吗?

@bigbinary/neeto-themes-frontend 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。

@bigbinary/neeto-themes-frontend 的下载量有多少?

根据 npm 官方下载统计,@bigbinary/neeto-themes-frontend 在 2026/10/08 – 2026/11/06 这 30 天内被下载 11,858 次,日均约 395 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bigbinary/neeto-themes-frontend 还在维护吗?

最新版本 4.2.3 发布于 2026/11/02(6 天前);至今共发布 158 个版本,其中过去 12 个月发布了 71 个;首次发布于 2024/05/07。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。