diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index eb066f4a202..8f290331da6 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -68,8 +68,8 @@ jobs: echo PHPUNIT='vendor/bin/simple-phpunit' >> $GITHUB_ENV [ 'lowest' = '${{ matrix.dependency-version }}' ] && export SYMFONY_DEPRECATIONS_HELPER=weak - # Typed has no tests, Turbo has its own workflow file - EXCLUDED_PACKAGES="Typed|Turbo" + # Turbo has its own workflow file + EXCLUDED_PACKAGES="Turbo" # Exclude deprecated packages when testing against lowest dependencies if [ "${{ matrix.dependency-version }}" = "lowest" ]; then diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a88a4478daf..9a1f99a086e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -611,39 +611,6 @@ importers: specifier: ^3.2.4 version: 3.2.4(@types/node@22.16.5)(@vitest/browser@3.2.4)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.10.4(@types/node@22.16.5)(typescript@5.8.3))(terser@5.43.1) - src/Typed/assets: - devDependencies: - '@hotwired/stimulus': - specifier: ^3.0.0 - version: 3.2.2 - '@testing-library/dom': - specifier: ^10.4.0 - version: 10.4.0 - '@testing-library/jest-dom': - specifier: ^6.6.3 - version: 6.6.3 - '@testing-library/user-event': - specifier: ^14.6.1 - version: 14.6.1(@testing-library/dom@10.4.0) - jsdom: - specifier: ^26.1.0 - version: 26.1.0 - tslib: - specifier: ^2.8.1 - version: 2.8.1 - tsx: - specifier: ^4.20.3 - version: 4.20.3 - typed.js: - specifier: ^2.0 - version: 2.1.0 - typescript: - specifier: ^5.8.3 - version: 5.8.3 - vitest: - specifier: ^3.2.4 - version: 3.2.4(@types/node@22.16.5)(@vitest/browser@3.2.4)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.10.4(@types/node@22.16.5)(typescript@5.8.3))(terser@5.43.1) - src/Vue/assets: devDependencies: '@hotwired/stimulus': @@ -2657,9 +2624,6 @@ packages: resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} engines: {node: '>=16'} - typed.js@2.1.0: - resolution: {integrity: sha512-bDuXEf7YcaKN4g08NMTUM6G90XU25CK3bh6U0THC/Mod/QPKlEt9g/EjvbYB8x2Qwr2p6J6I3NrsoYaVnY6wsQ==} - typescript@5.8.3: resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==} engines: {node: '>=14.17'} @@ -4777,8 +4741,6 @@ snapshots: type-fest@4.41.0: optional: true - typed.js@2.1.0: {} - typescript@5.8.3: {} ufo@1.6.1: {} diff --git a/src/Typed/.gitattributes b/src/Typed/.gitattributes deleted file mode 100644 index 3c8401b61de..00000000000 --- a/src/Typed/.gitattributes +++ /dev/null @@ -1,5 +0,0 @@ -/.git* export-ignore -/.symfony.bundle.yaml export-ignore -/assets/src export-ignore -/assets/test export-ignore -/doc export-ignore diff --git a/src/Typed/.github/PULL_REQUEST_TEMPLATE.md b/src/Typed/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index df3b474b452..00000000000 --- a/src/Typed/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,8 +0,0 @@ -Please do not submit any Pull Requests here. They will be closed. ---- - -Please submit your PR here instead: -https://github.com/symfony/ux - -This repository is what we call a "subtree split": a read-only subset of that main repository. -We're looking forward to your PR there! diff --git a/src/Typed/.github/workflows/close-pull-request.yml b/src/Typed/.github/workflows/close-pull-request.yml deleted file mode 100644 index 57e4e3fb074..00000000000 --- a/src/Typed/.github/workflows/close-pull-request.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Close Pull Request - -on: - pull_request_target: - types: [opened] - -jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: | - Thanks for your Pull Request! We love contributions. - - However, you should instead open your PR on the main repository: - https://github.com/symfony/ux - - This repository is what we call a "subtree split": a read-only subset of that main repository. - We're looking forward to your PR there! diff --git a/src/Typed/.gitignore b/src/Typed/.gitignore deleted file mode 100644 index 2cc9f0231c3..00000000000 --- a/src/Typed/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -/assets/node_modules/ -/vendor/ -/composer.lock -/phpunit.xml -/.phpunit.result.cache diff --git a/src/Typed/.symfony.bundle.yaml b/src/Typed/.symfony.bundle.yaml deleted file mode 100644 index 6d9a74acb76..00000000000 --- a/src/Typed/.symfony.bundle.yaml +++ /dev/null @@ -1,3 +0,0 @@ -branches: ["2.x"] -maintained_branches: ["2.x"] -doc_dir: "doc" diff --git a/src/Typed/CHANGELOG.md b/src/Typed/CHANGELOG.md deleted file mode 100644 index 152c335d498..00000000000 --- a/src/Typed/CHANGELOG.md +++ /dev/null @@ -1,35 +0,0 @@ -# CHANGELOG - -## 2.29.0 - -- Add Symfony 8 support - -## 2.26.0 - -- Deprecate the package - -## 2.13.2 - -- Revert "Change JavaScript package to `type: module`" - -## 2.13.0 - -- Change JavaScript package to `type: module` - -## 2.9.0 - -- A TypedBundle was added - which allows for integration with symfony/asset-mapper. - -- Add support for symfony/asset-mapper - -## 2.7.0 - -- Add `assets/src` to `.gitattributes` to exclude source TypeScript files from - installing. - -- TypeScript types are now included. - -## 2.6.0 - -- [BC BREAK] The `assets/` directory was moved from `Resources/assets/` to `assets/`. Make - sure the path in your `package.json` file is updated accordingly. diff --git a/src/Typed/LICENSE b/src/Typed/LICENSE deleted file mode 100644 index 0ed3a246553..00000000000 --- a/src/Typed/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/src/Typed/README.md b/src/Typed/README.md deleted file mode 100644 index 17352bc948f..00000000000 --- a/src/Typed/README.md +++ /dev/null @@ -1,151 +0,0 @@ -# Symfony UX Typed - -> [!WARNING] -> **Deprecated**: This package has been **deprecated** in 2.x and will be removed in the next major version. - -To keep the same functionality in your Symfony application, follow these migration steps: - -1. Install the `typed.js` library: - -```bash -# If using Symfony AssetMapper: -php bin/console importmap:require typed.js - -# If using NPM (e.g.: with Webpack Encore): -npm install typed.js -``` - -2. Add the following code to your app: - -
assets/controllers/typed_controller.js - -```javascript -import { Controller } from '@hotwired/stimulus'; -import Typed from 'typed.js'; - -export default class extends Controller { - static values = { - strings: Array, - typeSpeed: { type: Number, default: 30 }, - smartBackspace: { type: Boolean, default: true }, - startDelay: Number, - backSpeed: Number, - shuffle: Boolean, - backDelay: { type: Number, default: 700 }, - fadeOut: Boolean, - fadeOutClass: { type: String, default: 'typed-fade-out' }, - fadeOutDelay: { type: Number, default: 500 }, - loop: Boolean, - loopCount: { type: Number, default: Number.POSITIVE_INFINITY }, - showCursor: { type: Boolean, default: true }, - cursorChar: { type: String, default: '.' }, - autoInsertCss: { type: Boolean, default: true }, - attr: String, - bindInputFocusEvents: Boolean, - contentType: { type: String, default: 'html' }, - }; - - connect() { - const options = { - strings: this.stringsValue, - typeSpeed: this.typeSpeedValue, - smartBackspace: this.smartBackspaceValue, - startDelay: this.startDelayValue, - backSpeed: this.backSpeedValue, - shuffle: this.shuffleValue, - backDelay: this.backDelayValue, - fadeOut: this.fadeOutValue, - fadeOutClass: this.fadeOutClassValue, - fadeOutDelay: this.fadeOutDelayValue, - loop: this.loopValue, - loopCount: this.loopCountValue, - showCursor: this.showCursorValue, - cursorChar: this.cursorCharValue, - autoInsertCss: this.autoInsertCssValue, - attr: this.attrValue, - bindInputFocusEvents: this.bindInputFocusEventsValue, - contentType: this.contentTypeValue, - }; - - this.dispatchEvent('pre-connect', { options }); - const typed = new Typed(this.element, options); - this.dispatchEvent('connect', { typed, options }); - } - - dispatchEvent(name, payload) { - this.dispatch(name, { detail: payload, prefix: 'typed' }); - } -} -``` - -
- -3. Replace the `symfony--ux-typed` occurrences in your templates with `typed`, for example: - -```diff -{% set strings = [ - 'I ❤️ Symfony UX!', - 'Symfony UX Typed loves to type', - 'Symfony UX Typed and backspace', - 'Control the speed', - 'Control the cursor', - 'Control your destiny!!!', - 'Control your destiny... sort of', -] %} - -``` - -4. Remove `symfony/ux-typed` from your dependencies: - -```bash -composer remove symfony/ux-typed -``` - -You're done! - ---- - -Symfony UX Typed is a Symfony bundle integrating [Typed](https://github.com/mattboldt/typed.js/blob/master/README.md) in -Symfony applications. It is part of [the Symfony UX initiative](https://ux.symfony.com/). - -Typed is a complete and easy to use animated typed texts. -Just enter the strings you want to see typed, and it goes live without complexity. - -![Typed in action](doc/Animation.gif) - -**This repository is a READ-ONLY sub-tree split**. See -https://github.com/symfony/ux to create issues or submit pull requests. - -## Sponsor - -The Symfony UX packages are [backed][1] by [Mercure.rocks][2]. - -Create real-time experiences in minutes! Mercure.rocks provides a realtime API service -that is tightly integrated with Symfony: create UIs that update in live with UX Turbo, -send notifications with the Notifier component, expose async APIs with API Platform and -create low level stuffs with the Mercure component. We maintain and scale the complex -infrastructure for you! - -Help Symfony by [sponsoring][3] its development! - -## Resources - -- [Documentation](https://symfony.com/bundles/ux-typed/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) - -[1]: https://symfony.com/backers -[2]: https://mercure.rocks -[3]: https://symfony.com/sponsor diff --git a/src/Typed/assets/LICENSE b/src/Typed/assets/LICENSE deleted file mode 100644 index 0ed3a246553..00000000000 --- a/src/Typed/assets/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/src/Typed/assets/README.md b/src/Typed/assets/README.md deleted file mode 100644 index 3e29914369c..00000000000 --- a/src/Typed/assets/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# @symfony/ux-typed - -JavaScript assets of the [symfony/ux-typed](https://packagist.org/packages/symfony/ux-typed) PHP package. - -## Installation - -This npm package is **reserved for advanced users** who want to decouple their JavaScript dependencies from their PHP dependencies (e.g., when building Docker images, running JavaScript-only pipelines, etc.). - -We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-typed](https://packagist.org/packages/symfony/ux-typed) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. - -If you still want to install this package directly, please make sure its version exactly matches [symfony/ux-typed](https://packagist.org/packages/symfony/ux-typed) PHP package version: -```shell -composer require symfony/ux-typed:2.23.0 -npm add @symfony/ux-typed@2.23.0 -``` - -**Tip:** Your `package.json` file will be automatically modified by [Flex](https://github.com/symfony/flex) when installing or upgrading a PHP package. To prevent this behavior, ensure to **use at least Flex 1.22.0 or 2.5.0**, and run `composer config extra.symfony.flex.synchronize_package_json false`. - -## Resources - -- [Documentation](https://symfony.com/bundles/ux-typed/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) diff --git a/src/Typed/assets/dist/controller.d.ts b/src/Typed/assets/dist/controller.d.ts deleted file mode 100644 index c356ddf4993..00000000000 --- a/src/Typed/assets/dist/controller.d.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { Controller } from '@hotwired/stimulus'; - -declare class export_default extends Controller { - static values: { - strings: ArrayConstructor; - typeSpeed: { - type: NumberConstructor; - default: number; - }; - smartBackspace: { - type: BooleanConstructor; - default: boolean; - }; - startDelay: NumberConstructor; - backSpeed: NumberConstructor; - shuffle: BooleanConstructor; - backDelay: { - type: NumberConstructor; - default: number; - }; - fadeOut: BooleanConstructor; - fadeOutClass: { - type: StringConstructor; - default: string; - }; - fadeOutDelay: { - type: NumberConstructor; - default: number; - }; - loop: BooleanConstructor; - loopCount: { - type: NumberConstructor; - default: number; - }; - showCursor: { - type: BooleanConstructor; - default: boolean; - }; - cursorChar: { - type: StringConstructor; - default: string; - }; - autoInsertCss: { - type: BooleanConstructor; - default: boolean; - }; - attr: StringConstructor; - bindInputFocusEvents: BooleanConstructor; - contentType: { - type: StringConstructor; - default: string; - }; - }; - readonly stringsValue: string[]; - readonly typeSpeedValue: number; - readonly smartBackspaceValue: boolean; - readonly startDelayValue?: number; - readonly backSpeedValue?: number; - readonly shuffleValue?: boolean; - readonly backDelayValue: number; - readonly fadeOutValue?: boolean; - readonly fadeOutClassValue: string; - readonly fadeOutDelayValue: number; - readonly loopValue?: boolean; - readonly loopCountValue: number; - readonly showCursorValue: boolean; - readonly cursorCharValue: string; - readonly autoInsertCssValue: boolean; - readonly attrValue?: string; - readonly bindInputFocusEventsValue?: boolean; - readonly contentTypeValue: string; - connect(): void; - private dispatchEvent; -} - -export { export_default as default }; diff --git a/src/Typed/assets/dist/controller.js b/src/Typed/assets/dist/controller.js deleted file mode 100644 index 242224a4b2f..00000000000 --- a/src/Typed/assets/dist/controller.js +++ /dev/null @@ -1,56 +0,0 @@ -// src/controller.ts -import { Controller } from "@hotwired/stimulus"; -import Typed from "typed.js"; -var controller_default = class extends Controller { - connect() { - const options = { - strings: this.stringsValue, - typeSpeed: this.typeSpeedValue, - smartBackspace: this.smartBackspaceValue, - startDelay: this.startDelayValue, - backSpeed: this.backSpeedValue, - shuffle: this.shuffleValue, - backDelay: this.backDelayValue, - fadeOut: this.fadeOutValue, - fadeOutClass: this.fadeOutClassValue, - fadeOutDelay: this.fadeOutDelayValue, - loop: this.loopValue, - loopCount: this.loopCountValue, - showCursor: this.showCursorValue, - cursorChar: this.cursorCharValue, - autoInsertCss: this.autoInsertCssValue, - attr: this.attrValue, - bindInputFocusEvents: this.bindInputFocusEventsValue, - contentType: this.contentTypeValue - }; - this.dispatchEvent("pre-connect", { options }); - const typed = new Typed(this.element, options); - this.dispatchEvent("connect", { typed, options }); - } - dispatchEvent(name, payload) { - this.dispatch(name, { detail: payload, prefix: "typed" }); - } -}; -controller_default.values = { - strings: Array, - typeSpeed: { type: Number, default: 30 }, - smartBackspace: { type: Boolean, default: true }, - startDelay: Number, - backSpeed: Number, - shuffle: Boolean, - backDelay: { type: Number, default: 700 }, - fadeOut: Boolean, - fadeOutClass: { type: String, default: "typed-fade-out" }, - fadeOutDelay: { type: Number, default: 500 }, - loop: Boolean, - loopCount: { type: Number, default: Number.POSITIVE_INFINITY }, - showCursor: { type: Boolean, default: true }, - cursorChar: { type: String, default: "." }, - autoInsertCss: { type: Boolean, default: true }, - attr: String, - bindInputFocusEvents: Boolean, - contentType: { type: String, default: "html" } -}; -export { - controller_default as default -}; diff --git a/src/Typed/assets/package.json b/src/Typed/assets/package.json deleted file mode 100644 index 88f5c4adcbb..00000000000 --- a/src/Typed/assets/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "@symfony/ux-typed", - "description": "Typed integration for Symfony", - "license": "MIT", - "version": "2.29.1", - "keywords": [ - "symfony-ux" - ], - "homepage": "https://ux.symfony.com/typed", - "repository": "https://github.com/symfony/ux-typed", - "type": "module", - "files": [ - "dist" - ], - "main": "dist/controller.js", - "types": "dist/controller.d.ts", - "scripts": { - "build": "tsx ../../../bin/build_package.ts .", - "watch": "tsx ../../../bin/build_package.ts . --watch", - "test": "../../../bin/test_package.sh .", - "check": "biome check", - "ci": "biome ci" - }, - "symfony": { - "controllers": { - "typed": { - "main": "dist/controller.js", - "name": "symfony/ux-typed", - "webpackMode": "eager", - "fetch": "eager", - "enabled": true - } - }, - "importmap": { - "typed.js": "^2.0", - "@hotwired/stimulus": "^3.0.0" - } - }, - "peerDependencies": { - "@hotwired/stimulus": "^3.0.0", - "typed.js": "^2.0" - }, - "devDependencies": { - "@hotwired/stimulus": "^3.0.0", - "@testing-library/dom": "^10.4.0", - "@testing-library/jest-dom": "^6.6.3", - "@testing-library/user-event": "^14.6.1", - "jsdom": "^26.1.0", - "tslib": "^2.8.1", - "tsx": "^4.20.3", - "typed.js": "^2.0", - "typescript": "^5.8.3", - "vitest": "^3.2.4" - } -} diff --git a/src/Typed/assets/src/controller.ts b/src/Typed/assets/src/controller.ts deleted file mode 100644 index 5192a9b1757..00000000000 --- a/src/Typed/assets/src/controller.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -import { Controller } from '@hotwired/stimulus'; -import Typed from 'typed.js'; - -export default class extends Controller { - static values = { - strings: Array, - typeSpeed: { type: Number, default: 30 }, - smartBackspace: { type: Boolean, default: true }, - startDelay: Number, - backSpeed: Number, - shuffle: Boolean, - backDelay: { type: Number, default: 700 }, - fadeOut: Boolean, - fadeOutClass: { type: String, default: 'typed-fade-out' }, - fadeOutDelay: { type: Number, default: 500 }, - loop: Boolean, - loopCount: { type: Number, default: Number.POSITIVE_INFINITY }, - showCursor: { type: Boolean, default: true }, - cursorChar: { type: String, default: '.' }, - autoInsertCss: { type: Boolean, default: true }, - attr: String, - bindInputFocusEvents: Boolean, - contentType: { type: String, default: 'html' }, - }; - - declare readonly stringsValue: string[]; - declare readonly typeSpeedValue: number; - declare readonly smartBackspaceValue: boolean; - declare readonly startDelayValue?: number; - declare readonly backSpeedValue?: number; - declare readonly shuffleValue?: boolean; - declare readonly backDelayValue: number; - declare readonly fadeOutValue?: boolean; - declare readonly fadeOutClassValue: string; - declare readonly fadeOutDelayValue: number; - declare readonly loopValue?: boolean; - declare readonly loopCountValue: number; - declare readonly showCursorValue: boolean; - declare readonly cursorCharValue: string; - declare readonly autoInsertCssValue: boolean; - declare readonly attrValue?: string; - declare readonly bindInputFocusEventsValue?: boolean; - declare readonly contentTypeValue: string; - - connect() { - const options = { - strings: this.stringsValue, - typeSpeed: this.typeSpeedValue, - smartBackspace: this.smartBackspaceValue, - startDelay: this.startDelayValue, - backSpeed: this.backSpeedValue, - shuffle: this.shuffleValue, - backDelay: this.backDelayValue, - fadeOut: this.fadeOutValue, - fadeOutClass: this.fadeOutClassValue, - fadeOutDelay: this.fadeOutDelayValue, - loop: this.loopValue, - loopCount: this.loopCountValue, - showCursor: this.showCursorValue, - cursorChar: this.cursorCharValue, - autoInsertCss: this.autoInsertCssValue, - attr: this.attrValue, - bindInputFocusEvents: this.bindInputFocusEventsValue, - contentType: this.contentTypeValue, - }; - - this.dispatchEvent('pre-connect', { options }); - const typed = new Typed(this.element, options); - this.dispatchEvent('connect', { typed, options }); - } - - private dispatchEvent(name: string, payload: any) { - this.dispatch(name, { detail: payload, prefix: 'typed' }); - } -} diff --git a/src/Typed/assets/test/controller.test.ts b/src/Typed/assets/test/controller.test.ts deleted file mode 100644 index 453a35ecfa0..00000000000 --- a/src/Typed/assets/test/controller.test.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -import { Application, Controller } from '@hotwired/stimulus'; -import { getByTestId, waitFor } from '@testing-library/dom'; -import { afterEach, beforeEach, describe, expect, it } from 'vitest'; -import { clearDOM, mountDOM } from '../../../../test/stimulus-helpers'; -import TypedController from '../src/controller'; - -// Controller used to check the actual controller was properly booted -class CheckController extends Controller { - connect() { - this.element.addEventListener('typed:connect', () => { - this.element.classList.add('connected'); - }); - this.element.addEventListener('typed:pre-connect', () => { - this.element.classList.add('pre-connected'); - }); - } -} - -const startStimulus = () => { - const application = Application.start(); - application.register('check', CheckController); - application.register('typed', TypedController); -}; - -describe('TypedController', () => { - let container: HTMLElement; - - beforeEach(() => { - container = mountDOM(` - - - Symfony UX - - -
- I created this UX component because -
- - - `); - }); - - afterEach(() => { - clearDOM(); - }); - - it('pre-connect', async () => { - expect(getByTestId(container, 'typed')).not.toHaveClass('pre-connected'); - expect(getByTestId(container, 'typed')).not.toHaveClass('connected'); - - startStimulus(); - await waitFor(() => expect(getByTestId(container, 'typed')).toHaveClass('pre-connected')); - await waitFor(() => expect(getByTestId(container, 'typed')).toHaveClass('connected')); - }); -}); diff --git a/src/Typed/composer.json b/src/Typed/composer.json deleted file mode 100644 index 81709aa2fa5..00000000000 --- a/src/Typed/composer.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "symfony/ux-typed", - "type": "symfony-bundle", - "description": "Typed integration for Symfony", - "keywords": [ - "symfony-ux" - ], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Florent Morselli", - "email": "contact@spomky-labs.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "autoload": { - "psr-4": { - "Symfony\\UX\\Typed\\": "src/" - } - }, - "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3" - }, - "conflict": { - "symfony/flex": "<1.13" - }, - "extra": { - "thanks": { - "name": "symfony/ux", - "url": "https://github.com/symfony/ux" - } - }, - "minimum-stability": "dev" -} diff --git a/src/Typed/doc/Animation.gif b/src/Typed/doc/Animation.gif deleted file mode 100644 index 3ef485c5287..00000000000 Binary files a/src/Typed/doc/Animation.gif and /dev/null differ diff --git a/src/Typed/doc/index.rst b/src/Typed/doc/index.rst deleted file mode 100644 index cc4685c74f5..00000000000 --- a/src/Typed/doc/index.rst +++ /dev/null @@ -1,166 +0,0 @@ -Symfony UX Typed -================ - -.. warning:: - - **Deprecated: This package has been deprecated in 2.x and will be removed in the next major version.** - - To keep the same functionality in your Symfony application, please follow the migration steps - from the `Symfony UX Typed README.md`_. - -Symfony UX Typed is a Symfony bundle integrating `Typed`_ in -Symfony applications. It is part of `the Symfony UX initiative`_. - -Typed is a complete and easy to use animated typed texts. -Just enter the strings you want to see typed, and it goes live without complexity. - -.. image:: Animation.gif - :alt: Typed showing messages - -Installation ------------- - -.. caution:: - - Before you start, make sure you have `StimulusBundle configured in your app`_. - -Install the bundle using Composer and Symfony Flex: - -.. code-block:: terminal - - $ composer require symfony/ux-typed - -If you're using WebpackEncore, install your assets and restart Encore (not -needed if you're using AssetMapper): - -.. code-block:: terminal - - $ npm install --force - $ npm run watch - -.. note:: - - For more complex installation scenarios, you can install the JavaScript assets through the `@symfony/ux-typed npm package`_ - -Usage ------ - -Typed works using a list of strings and will manage typing them on your page. -It comes with a lot of parameters to customize the way the strings are typed: speed, cursor, delays -and smart backspace are some incredible parameters you can use. - -The main usage of Symfony UX Typed is to use its Stimulus controller to initialize Typed: - -.. code-block:: html+twig - -
- I created this UX component because - -
- - -That's it! Typed now shows the messages defined in the ``strings`` argument. -You can customize the way those messages are typed. -Parameters are exactly the same as for the `typed library`_ - -.. code-block:: html+twig - -
- I created this UX component because - -
- -Extend the JavaScript Controller -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Symfony UX Typed allows you to extend its default behavior using a custom -Stimulus controller: - -.. code-block:: javascript - - // assets/controllers/mytyped_controller.js - - import { Controller } from '@hotwired/stimulus'; - - export default class extends Controller { - initialize() { - this._onPreConnect = this._onPreConnect.bind(this); - this._onConnect = this._onConnect.bind(this); - } - - connect() { - this.element.addEventListener('typed:pre-connect', this._onPreConnect); - this.element.addEventListener('typed:connect', this._onConnect); - } - - disconnect() { - // You should always remove listeners when the controller is disconnected to avoid side-effects - this.element.removeEventListener('typed:connect', this._onConnect); - this.element.removeEventListener('typed:pre-connect', this._onPreConnect); - } - - _onPreConnect(event) { - // Typed has not been initialized - options can be changed - console.log(event.detail.options); // Options that will be used to initialize Typed - event.detail.options.onBegin = (typed) => { - console.log("Typed is ready to type cool messages!"); - }; - event.detail.options.onStop = (typed) => { - console.log("OK. Enough is enough."); - }; - } - - _onConnect(event) { - // Typed has just been initialized and you can access details from the event - console.log(event.detail.typed); // Typed instance - console.log(event.detail.options); // Options used to initialize Typed - } - } - -.. code-block:: - -Then in your template, add your controller to the HTML attribute: - -.. code-block:: html+twig - - - - Typed - {# ... #} - - - {# ... #} - - - -.. note:: - - Be careful to add your controller **before** the Typed controller so that it - is executed before and can listen on the ``typed:connect`` event properly. - -Backward Compatibility promise ------------------------------- - -This bundle aims at following the same Backward Compatibility promise as -the Symfony framework: -https://symfony.com/doc/current/contributing/code/bc.html - -.. _`Typed`: https://github.com/mattboldt/typed.js/blob/master/README.md -.. _`the Symfony UX initiative`: https://ux.symfony.com/ -.. _`typed library`: https://github.com/mattboldt/typed.js/blob/master/README.md -.. _StimulusBundle configured in your app: https://symfony.com/bundles/StimulusBundle/current/index.html -.. _`@symfony/ux-typed npm package`: https://www.npmjs.com/package/@symfony/ux-typed -.. _`Symfony UX Typed README.md`: https://github.com/symfony/ux/tree/2.x/src/Typed diff --git a/src/Typed/src/DependencyInjection/TypedExtension.php b/src/Typed/src/DependencyInjection/TypedExtension.php deleted file mode 100644 index 5e901d624c6..00000000000 --- a/src/Typed/src/DependencyInjection/TypedExtension.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\UX\Typed\DependencyInjection; - -use Symfony\Component\AssetMapper\AssetMapperInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; -use Symfony\Component\HttpKernel\DependencyInjection\Extension; - -trigger_deprecation('symfony/ux-typed', '2.27.0', 'The package is deprecated and will be removed in 3.0. Follow the migration steps in https://github.com/symfony/ux/tree/2.x/src/Typed to keep using Typed in your Symfony application.'); - -/** - * @internal - */ -class TypedExtension extends Extension implements PrependExtensionInterface -{ - public function load(array $configs, ContainerBuilder $container): void - { - } - - public function prepend(ContainerBuilder $container): void - { - if (!$this->isAssetMapperAvailable($container)) { - return; - } - - $container->prependExtensionConfig('framework', [ - 'asset_mapper' => [ - 'paths' => [ - __DIR__.'/../../assets/dist' => '@symfony/ux-typed', - ], - ], - ]); - } - - private function isAssetMapperAvailable(ContainerBuilder $container): bool - { - if (!interface_exists(AssetMapperInterface::class)) { - return false; - } - - // check that FrameworkBundle 6.3 or higher is installed - $bundlesMetadata = $container->getParameter('kernel.bundles_metadata'); - if (!isset($bundlesMetadata['FrameworkBundle'])) { - return false; - } - - return is_file($bundlesMetadata['FrameworkBundle']['path'].'/Resources/config/asset_mapper.php'); - } -} diff --git a/src/Typed/src/TypedBundle.php b/src/Typed/src/TypedBundle.php deleted file mode 100644 index 808fa55d706..00000000000 --- a/src/Typed/src/TypedBundle.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\UX\Typed; - -use Symfony\Component\HttpKernel\Bundle\Bundle; - -trigger_deprecation('symfony/ux-typed', '2.27.0', 'The package is deprecated and will be removed in 3.0. Follow the migration steps in https://github.com/symfony/ux/tree/2.x/src/Typed to keep using Typed in your Symfony application.'); - -/** - * @final - */ -class TypedBundle extends Bundle -{ - public function getPath(): string - { - return \dirname(__DIR__); - } -} diff --git a/test_apps/encore-app/assets/controllers.json b/test_apps/encore-app/assets/controllers.json index 61a7caedbc2..f8a100fee0f 100644 --- a/test_apps/encore-app/assets/controllers.json +++ b/test_apps/encore-app/assets/controllers.json @@ -100,12 +100,6 @@ "fetch": "eager" } }, - "@symfony/ux-typed": { - "typed": { - "enabled": true, - "fetch": "eager" - } - }, "@symfony/ux-vue": { "vue": { "enabled": true, diff --git a/test_apps/encore-app/composer.json b/test_apps/encore-app/composer.json index 0c7c486b8e3..82bd0f9c761 100644 --- a/test_apps/encore-app/composer.json +++ b/test_apps/encore-app/composer.json @@ -30,7 +30,6 @@ "symfony/ux-translator": "^2.23", "symfony/ux-turbo": "^2.23", "symfony/ux-twig-component": "^2.23", - "symfony/ux-typed": "^2.23", "symfony/ux-vue": "^2.23", "symfony/webpack-encore-bundle": "^2.2", "symfony/yaml": "7.2.*" diff --git a/test_apps/encore-app/config/bundles.php b/test_apps/encore-app/config/bundles.php index 2f055ee053b..a71523ebb31 100644 --- a/test_apps/encore-app/config/bundles.php +++ b/test_apps/encore-app/config/bundles.php @@ -21,6 +21,5 @@ Symfony\UX\TogglePassword\TogglePasswordBundle::class => ['all' => true], Symfony\UX\Translator\UxTranslatorBundle::class => ['all' => true], Symfony\UX\Turbo\TurboBundle::class => ['all' => true], - Symfony\UX\Typed\TypedBundle::class => ['all' => true], Symfony\UX\Vue\VueBundle::class => ['all' => true], ]; diff --git a/test_apps/encore-app/package.json b/test_apps/encore-app/package.json index 64c60b642d0..dad9d8cc00f 100644 --- a/test_apps/encore-app/package.json +++ b/test_apps/encore-app/package.json @@ -21,7 +21,6 @@ "@symfony/ux-toggle-password": "file:vendor/symfony/ux-toggle-password/assets", "@symfony/ux-translator": "file:vendor/symfony/ux-translator/assets", "@symfony/ux-turbo": "file:vendor/symfony/ux-turbo/assets", - "@symfony/ux-typed": "file:vendor/symfony/ux-typed/assets", "@symfony/ux-vue": "file:vendor/symfony/ux-vue/assets", "@symfony/webpack-encore": "^5.0.0", "chart.js": "^3.4.1 || ^4.0", @@ -35,7 +34,6 @@ "svelte": "^3.0 || ^4.0", "svelte-loader": "^3.2.4", "tom-select": "^2.2.2", - "typed.js": "^2.0", "vue": "^3.0", "vue-loader": "^17.0.0", "webpack": "^5.74.0", diff --git a/test_apps/encore-app/symfony.lock b/test_apps/encore-app/symfony.lock index 2756101e876..ec3bc6f9cc3 100644 --- a/test_apps/encore-app/symfony.lock +++ b/test_apps/encore-app/symfony.lock @@ -256,9 +256,6 @@ "assets/svelte/controllers/Hello.svelte" ] }, - "symfony/ux-swup": { - "version": "v2.23.0" - }, "symfony/ux-toggle-password": { "version": "v2.23.0" }, diff --git a/ux.symfony.com/assets/controllers.json b/ux.symfony.com/assets/controllers.json index 5b5375a5a81..1e301eabbcd 100644 --- a/ux.symfony.com/assets/controllers.json +++ b/ux.symfony.com/assets/controllers.json @@ -94,12 +94,6 @@ "fetch": "lazy" } }, - "@symfony/ux-typed": { - "typed": { - "enabled": true, - "fetch": "lazy" - } - }, "@symfony/ux-vue": { "vue": { "enabled": true, diff --git a/ux.symfony.com/composer.json b/ux.symfony.com/composer.json index 6a3198f2250..dda10666536 100644 --- a/ux.symfony.com/composer.json +++ b/ux.symfony.com/composer.json @@ -49,7 +49,6 @@ "symfony/ux-translator": "2.x-dev", "symfony/ux-turbo": "2.x-dev", "symfony/ux-twig-component": "2.x-dev", - "symfony/ux-typed": "2.x-dev", "symfony/ux-vue": "2.x-dev", "symfony/validator": "7.2.*", "symfony/yaml": "7.2.*", diff --git a/ux.symfony.com/composer.lock b/ux.symfony.com/composer.lock index abef0dce226..418d80e29a8 100644 --- a/ux.symfony.com/composer.lock +++ b/ux.symfony.com/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cb6b21545f526b7e56b3d51e502ff6cf", + "content-hash": "6c79221d08e8c24c875bf442d76aac9a", "packages": [ { "name": "composer/semver", @@ -8662,74 +8662,6 @@ ], "time": "2025-01-25T02:19:26+00:00" }, - { - "name": "symfony/ux-typed", - "version": "2.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/ux-typed.git", - "reference": "07b8b33a68a66b20dd4df8e3f9b9618e74a786f1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/ux-typed/zipball/07b8b33a68a66b20dd4df8e3f9b9618e74a786f1", - "reference": "07b8b33a68a66b20dd4df8e3f9b9618e74a786f1", - "shasum": "" - }, - "conflict": { - "symfony/flex": "<1.13" - }, - "default-branch": true, - "type": "symfony-bundle", - "extra": { - "thanks": { - "url": "https://github.com/symfony/ux", - "name": "symfony/ux" - } - }, - "autoload": { - "psr-4": { - "Symfony\\UX\\Typed\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Florent Morselli", - "email": "contact@spomky-labs.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Typed integration for Symfony", - "homepage": "https://symfony.com", - "keywords": [ - "symfony-ux" - ], - "support": { - "source": "https://github.com/symfony/ux-typed/tree/v2.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-12-05T14:25:02+00:00" - }, { "name": "symfony/ux-vue", "version": "2.x-dev", @@ -12824,7 +12756,6 @@ "symfony/ux-translator": 20, "symfony/ux-turbo": 20, "symfony/ux-twig-component": 20, - "symfony/ux-typed": 20, "symfony/ux-vue": 20 }, "prefer-stable": true, diff --git a/ux.symfony.com/config/bundles.php b/ux.symfony.com/config/bundles.php index ed8e970cf51..8a9c0837f2a 100644 --- a/ux.symfony.com/config/bundles.php +++ b/ux.symfony.com/config/bundles.php @@ -25,7 +25,6 @@ Symfony\UX\Svelte\SvelteBundle::class => ['all' => true], Symfony\UX\Translator\UxTranslatorBundle::class => ['all' => true], Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true], - Symfony\UX\Typed\TypedBundle::class => ['all' => true], Zenstruck\Foundry\ZenstruckFoundryBundle::class => ['dev' => true, 'test' => true], Symfony\UX\TogglePassword\TogglePasswordBundle::class => ['all' => true], Symfonycasts\SassBundle\SymfonycastsSassBundle::class => ['all' => true], diff --git a/ux.symfony.com/importmap.php b/ux.symfony.com/importmap.php index f3a9a6453a0..bbacbe9d07e 100644 --- a/ux.symfony.com/importmap.php +++ b/ux.symfony.com/importmap.php @@ -91,9 +91,6 @@ '@hotwired/turbo' => [ 'version' => '8.0.4', ], - 'typed.js' => [ - 'version' => '2.1.0', - ], 'snarkdown' => [ 'version' => '2.0.0', ], @@ -183,4 +180,12 @@ '@symfony/ux-leaflet-map' => [ 'path' => './vendor/symfony/ux-leaflet-map/assets/dist/map_controller.js', ], + 'tom-select/dist/css/tom-select.default.css' => [ + 'version' => '2.4.3', + 'type' => 'css', + ], + 'tom-select/dist/css/tom-select.bootstrap4.css' => [ + 'version' => '2.4.3', + 'type' => 'css', + ], ]; diff --git a/ux.symfony.com/src/Service/UxPackageRepository.php b/ux.symfony.com/src/Service/UxPackageRepository.php index b4791130f63..45fee897d65 100644 --- a/ux.symfony.com/src/Service/UxPackageRepository.php +++ b/ux.symfony.com/src/Service/UxPackageRepository.php @@ -254,6 +254,7 @@ public function findAll(?string $query = null, ?bool $deprecated = null): array 'linear-gradient(95deg, #20A091 -5%, #4EC9B3 105%)', 'Animated Typing with Typed.js', 'Animated typing with Typed.js', + isDeprecated: true )) ->setDocsLink('https://github.com/mattboldt/typed.js/', 'Typed.js documentation'), ]; diff --git a/ux.symfony.com/symfony.lock b/ux.symfony.com/symfony.lock index ae918923a7d..f0c43313f0a 100644 --- a/ux.symfony.com/symfony.lock +++ b/ux.symfony.com/symfony.lock @@ -632,9 +632,6 @@ "symfony/ux-twig-component": { "version": "v2.1.0" }, - "symfony/ux-typed": { - "version": "2.x-dev" - }, "symfony/ux-vue": { "version": "2.x-dev" }, diff --git a/ux.symfony.com/templates/ux_packages/typed.html.twig b/ux.symfony.com/templates/ux_packages/typed.html.twig index 94582547a54..c890d3a993f 100644 --- a/ux.symfony.com/templates/ux_packages/typed.html.twig +++ b/ux.symfony.com/templates/ux_packages/typed.html.twig @@ -1,45 +1,58 @@ -{% extends 'ux_packages/package.html.twig' %} +{% extends 'base.html.twig' %} -{% block package_header %} - {% component PackageHeader with { - package: 'typed', - eyebrowText: 'A Library that Types' - } %} - {% block title_header %} - Typed brings text to life - {% endblock %} +{% set meta = { + title: package.humanName ~ ' - Symfony UX 2', + description: package.description, + canonical: url(package.route), + social: { + title: package.tagline ~ ' - Symfony UX 2' ~ package.humanName|u.trimStart('UX '), + description: package.description|striptags, + image: { + url: absolute_url(asset(package.getSocialImage('1200x675'))), + type: 'image/png', + width: 1200, + height: 675, + alt: package.humanName ~ ' - Component Icon', + }, + } +} %} - {% block sub_content %} - Spice up some text by typing, backspacing and re-typing with Typed.js. - {% endblock %} - {% endcomponent %} +{% block main %} +
+
+

Deprecated Package

+

UX Typed 2.x

+

This component is deprecated and will not receive further updates.
+ Please follow the migration steps + if you want to keep using Typed in your app.

+
+
{% endblock %} -{% block code_block_left %} - -{% endblock %} - -{% block code_block_right %} -
- {% set strings = [ - 'I ❤️ Symfony UX!', - 'Symfony UX Typed loves to type', - 'Symfony UX Typed and backspace', - 'Control the speed', - 'Control the cursor', - 'Control your destiny!!!', - 'Control your destiny... sort of', - ] %} - -
+{% block stylesheets %} + {{ parent() }} + {% endblock %} diff --git a/ux.symfony.com/tests/baseline-ignore b/ux.symfony.com/tests/baseline-ignore index db6f6e22afb..59ebb3a8e3e 100644 --- a/ux.symfony.com/tests/baseline-ignore +++ b/ux.symfony.com/tests/baseline-ignore @@ -1,3 +1,2 @@ -%Since symfony/ux-typed 2\.27\.0: The package is deprecated and will be removed in 3\.0\.% %Since symfony/ux-lazy-image 2\.27\.0: The package is deprecated and will be removed in 3\.0\.% %Since symfony/ux-toggle-password 2\.29\.0: The package is deprecated and will be removed in 3\.0\.%