定制 jvmtech/neos-imagefocalpointeditor 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jvmtech/neos-imagefocalpointeditor

最新稳定版本:0.1.1

Composer 安装命令:

composer require jvmtech/neos-imagefocalpointeditor

包简介

README 文档

README

Latest Stable Version License

A Neos CMS UI plugin that adds an interactive focal point editor for images in the Neos Inspector.

What it does

This package registers a custom property editor in the Neos backend that allows editors to visually select a focal point on an image. The selected coordinates are stored as a JSON string {"x": number, "y": number} (integer pixel values) and can then be used in Fusion to influence image rendering or cropping.

The editor displays a scaled preview of the image (respecting any crop and resize adjustments applied in the media module) and lets the user click to place the focal point.

In general, the package can be used to provide a two-dimensional coordinate selector for various different purposes like positioning an element on top of an image at a chosen position.

Requirements

  • Neos UI ^9.0

Installation

Install via Composer:

composer require jvmtech/neos-imagefocalpointeditor

Example

neos-focal-point.png

Configuration

Add the editor to a node type property using the editor key JvMTECH.Neos.ImageFocalPointEditor/ImageFocalPointEditor:

'Your.Package:YourNodeType':
  properties:
    focalPoint:
      type: string
      ui:
        label: 'Focal Point'
        inspector:
          group: 'image'
          editor: 'JvMTECH.Neos.ImageFocalPointEditor/ImageFocalPointEditor'
          editorOptions:
            imageProperty: 'image'

Editor Options

Option Type Description
imageProperty string The name of the image property on the same node to use as the preview. Prefix with parent: to reference a property on the parent node (e.g. parent:image).

Referencing a parent node's image

If the focal point property lives on a child node but the image is on the parent node, use the parent: prefix:

editorOptions:
  imageProperty: 'parent:image'

Stored value format

The property value is a JSON string with x/y coordinates as integer percentages (0–100):

{"x": 42, "y": 30}

Fusion: ObjectPosition augmenter

The package ships a ready-to-use Fusion prototype that applies the focal point as a CSS object-position inline style via Neos.Fusion:Augmenter:

prototype(JvMTECH.Neos.ImageFocalPointEditor:ObjectPosition)

It wraps any content and injects style="object-position: {x}% {y}%;". When no focal point is set the value falls back to initial.

Props

Prop Default Description
focalPoint Neos.Fusion:DataStructure (empty) Parsed focal point object with x and y keys
cssProperty object-position CSS property name written into the style attribute
content The child markup to augment

Example usage

renderer = afx`
    <JvMTECH.Neos.ImageFocalPointEditor:ObjectPosition
        focalPoint={Json.parse(q(node).property('focalPoint'))}
    >
        <Neos.Neos:ImageTag asset={q(node).property('image')} />
    </JvMTECH.Neos.ImageFocalPointEditor:ObjectPosition>
`

Development

The frontend source lives in Resources/Private/Scripts/. It is built with esbuild and outputs to Resources/Public/ImageFocalPointEditor/.

cd Resources/Private/Scripts

# Install dependencies
yarn install

# Production build
yarn build

# Watch mode
yarn watch

Tech stack

统计信息

  • 总下载量: 53
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固