承接 sitegeist/kaleidoscope-valueobjects 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

sitegeist/kaleidoscope-valueobjects

Composer 安装命令:

composer require sitegeist/kaleidoscope-valueobjects

包简介

Value objects and editors based on Kaleidoscope

README 文档

README

Proxy objects for ImageSources

Proxy objects for ImageSources that can be edited in the inspector directly and allow editing of images and image collections together with alt and title for each item.

Authors & Sponsors

The development and the public-releases of this package is generously sponsored by our employer http://www.sitegeist.de.

Installation

Sitegeist.Kaleidoscope.ValueObjects is available via packagist run composer require sitegeist/kaleidoscope-valueobjects. We use semantic versioning so every breaking change will increase the major-version number.

Usage

NodeTypes

Single images are edited via property type Sitegeist\Kaleidoscope\ValueObjects\ImageSourceProxy.

    imageSourceProxy:
      type: 'Sitegeist\Kaleidoscope\ValueObjects\ImageSourceProxy'
      defaultValue: null
      ui:
        label: 'Image'
        inspector:
          group: imageWithMetadata

Lists of images are edited via property type Sitegeist\Kaleidoscope\ValueObjects\ImageSourceProxyCollection.

    imageSourceProxyCollection:
      type: 'Sitegeist\Kaleidoscope\ValueObjects\ImageSourceProxyCollection'
      defaultValue: []
      ui:
        label: 'Images'
        inspector:
          group: imageWithMetadata

Inspector Editor Configuration

For properties of type Sitegeist\Kaleidoscope\ValueObjects\ImageSourceProxy and ...\ImageSourceProxyCollection dedicated inspector editors Sitegeist.Kaleidoscope.ValueObjects/Inspector/Editors/AssetWithMetadataEditor and .../AssetWithMetadataCollectionEditor are provided and configured for the Proxy Objects. The Editor Configuration is derived from the options as the Neos ImageEditor as is documented here.

Options Reference:

  • maximumFileSize (string) Set the maximum allowed file size to be uploaded. Accepts numeric or formatted string values, e.g. "204800" or "204800b" or "2kb". Defaults to the maximum allowed upload size configured in php.ini
  • constraints
    • mediaTypes (array) If set, the media browser and file upload will be limited to assets with the specified media type. Default ['image/*'] Example: ['image/png', 'image/jpeg'] Note: Due to technical limitations the media browser currently ignores the media sub type, so image/png has the same effect as image/*
    • assetSources (array) If set, the media browser will be limited to assets of the specified asset source. Default: [] (all asset sources) Example: ['neos', 'custom_asset_source]
  • features
    • crop (boolean) If true, enable image cropping. Default true.
    • upload (boolean) If true, enable Upload button, allowing new files to be uploaded directly in the editor. Default true.
    • mediaBrowser (boolean) If true, enable Media Browser button. Default true.
  • resize (boolean) If true, enable image resizing. Default FALSE.
  • crop crop-related options. Only relevant if features.crop is enabled.
    • aspectRatio
      • forceCrop (boolean) Show the crop dialog on image upload
        • locked Locks the aspect ratio to a specific width/height ratio
          • width (integer) width of the aspect ratio which shall be enforced
          • height (integer) height of the aspect ratio which shall be enforced
        • options aspect-ratio presets. Only effective if locked is not set.
          • [presetIdentifier]
            • width (required integer) the width of the aspect ratio preset
            • height (required integer) the height of the aspect ratio preset
            • label (string) human-readable name of the aspect ratio preset
        • enableOriginal (boolean) If true, the image ratio of the original image can be chosen in the selector. Only effective if locked is not set. Default true.
        • allowCustom (boolean) If true, a completely custom image ratio can be chosen. Only effective if locked is not set. Default true.
        • defaultOption (string) default aspect ratio option to be chosen if no cropping has been applied already.
  • disabled (boolean) If true, disables the ImageEditor.

EEL & Fusion

When one of the proxy objects is passed to a Sitegeist.Kaleidoscope.Image|Picture|Source prototype as imageSource the value is automatically converted into an ImageSourceInterface.

    example = Sitegeist.Kaleidoscope:Image {
        imageSource = ${q(node).property('imageSourceProxy')}
    }

If you need more control over the conversion from proxies to image sources you can use you can use the Kaleidoscope.ValueObjects helper. Be careful as those methods only allow the ImageSourceProxy, ImageSourceProxyCollection and null as parameter.

imageSource = ${Sitegeist.Kaleidoscope.ValueObjects.unwrapProxy(q(node).property('imageSourceProxy'))}
imageSources = ${Sitegeist.Kaleidoscope.ValueObjects.unwrapProxyCollection(q(node).property('imageSourceProxyCollection'))}

There are also fusion prototypes that will check the type of the given value convert ImageSourceProxy, ImageSourceProxyCollection but leave all other values untouched.

# read imageSourceProxy and convert to imageSource
imageSource = ${q(node).property('imageSourceProxy')}
imageSource.@process.unwrapImageSourceProxy = Sitegeist.Kaleidoscope.ValueObjects:ImageSourceProxyUnwrapper

imageSources = ${q(node).property('imageSourceProxyCollection')}
imageSources.@process.unwrapImageSourceProxy = Sitegeist.Kaleidoscope.ValueObjects:ImageSourceProxyCollectionUnwrapper

Migration of existing data

For Neos 8 the package Sitegeist.Kaleidoscope.ValueObjects.Migrations provides migrations to convert existing Nodes to the new ImageSourceProxy and ImageSourceProxyCollection. The package can be installed via composer require sitegeist/kaleidoscope-valueobjects-migrations.

Migrations for Neos 9 are not yet available but will be in a separate package.

Development

To build the javascript for the inspector-editors the following docker commands can be used.

# run development build
docker run -it -v $(pwd):/app -w /app node:23 sh -c "yarn && yarn build:dev"

# run production build 
docker run -it -v $(pwd):/app -w /app node:23 sh -c "yarn && yarn build"

Contribution

We will gladly accept contributions. Please send us pull requests.

sitegeist/kaleidoscope-valueobjects 适用场景与选型建议

sitegeist/kaleidoscope-valueobjects 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 6.33k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2025 年 03 月 07 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 sitegeist/kaleidoscope-valueobjects 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 sitegeist/kaleidoscope-valueobjects 我们能提供哪些服务?
定制开发 / 二次开发

基于 sitegeist/kaleidoscope-valueobjects 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 6.33k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 9
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2025-03-07