Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions assets/build-dist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './scripts/admin-cms';
15,612 changes: 15,612 additions & 0 deletions assets/dist/cms-bundle.min.js

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions assets/dist/entrypoints.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"entrypoints": {
"cms-bundle.min": {
"js": [
"./cms-bundle.min.js"
]
}
}
}
3 changes: 3 additions & 0 deletions assets/dist/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cms-bundle.min.js": "./cms-bundle.min.js"
}
21 changes: 18 additions & 3 deletions assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,26 @@
"@softspring/polymorphic-form-type": "*"
},
"devDependencies": {
"@babel/core": "^7.24.4",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/preset-env": "^7.24.4",
"@eslint/js": "^9.11.1",
"eslint": "^8.57.1",
"globals": "^15.9.0",
"@softspring/collection-form-type": "file:./../vendor/softspring/collection-form-type/assets",
"@softspring/media-bundle": "file:./../vendor/softspring/media-bundle/assets",
"@softspring/polymorphic-form-type": "file:./../vendor/softspring/polymorphic-form-type/assets"
"@softspring/polymorphic-form-type": "file:./../vendor/softspring/polymorphic-form-type/assets",
"@symfony/webpack-encore": "^5.0.1",
"babel-loader": "^9.2.1",
"core-js": "^3.38.1",
"eslint": "^9.12.0",
"file-loader": "^6.2.0",
"globals": "^15.10.0",
"sass": "^1.79.4",
"sass-loader": "^16.0.2",
"webpack": "^5.95.0",
"webpack-cli": "^5.1.4",
"webpack-notifier": "^1.15.0"
},
"scripts": {
"build": "encore production"
}
}
2 changes: 1 addition & 1 deletion assets/scripts/admin/confirm-modal.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Modal} from 'bootstrap';
import {registerFeature,addTargetEventListener} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature,addTargetEventListener} from '../tools';

registerFeature('admin_confirm_modal', _init);

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/admin/content-edit/config-errors.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../../tools';

registerFeature('admin_content_edit_config_errors', _init);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {cmsEditListener} from './event-listeners';
import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../../tools';

registerFeature('admin_content_edit_content_enter_inserts_module', _init);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {cmsEditListener} from './event-listeners';
import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../../tools';

registerFeature('admin_content_edit_content_tab_contenteditable', _init);

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/admin/content-edit/contenteditable-focus.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {getInputsFromElement, getPreviewElementsFromInput} from './contenteditable';
import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../../tools';

registerFeature('admin_content_edit_contenteditable_focus', _init);

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/admin/content-edit/contenteditable.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {getSelectedLanguage} from './filter-preview';
import {callForeachSelector, registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {callForeachSelector, registerFeature} from '../../tools';

registerFeature('admin_content_edit_contenteditable', _init);

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/admin/content-edit/filter-preview.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../../tools';

registerFeature('admin_content_edit_filter_preview', _init);

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/admin/content-edit/locale-filter-modules.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {filterCurrentFilterElements} from "./filter-preview";
import {cmsEditListener} from './event-listeners';
import {callForeachSelector, registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {callForeachSelector, registerFeature} from '../../tools';

registerFeature('admin_content_edit_locale_filter_modules', _init);

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/admin/content-edit/modules.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {filterCurrentFilterElements} from './filter-preview';
import {getCollectionLastIndex} from '@softspring/collection-form-type/scripts/collection-form-type';
import {Modal} from 'bootstrap';
import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../../tools';

registerFeature('admin_content_edit_modules', _init);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {cmsEditListener} from './event-listeners';
import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../../tools';

registerFeature('admin_content_edit_preview_background_color', _init);

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/admin/content-edit/preview-block.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {cmsEditListener} from './event-listeners';
import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../../tools';

registerFeature('admin_content_edit_preview_block', _init);

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/admin/content-edit/preview-class.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {cmsEditListener} from './event-listeners';
import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../../tools';

registerFeature('admin_content_edit_preview_class', _init);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../../tools';

registerFeature('admin_content_edit_preview_collection_node_class', _init);

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/admin/content-edit/preview-fill.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../../tools';

registerFeature('admin_content_edit_preview_fill', _init);

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/admin/content-edit/preview-id.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {cmsEditListener} from './event-listeners';
import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../../tools';

registerFeature('admin_content_edit_preview_id', _init);

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/admin/content-edit/preview-media-choice.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../../tools';

registerFeature('admin_content_edit_preview_media_choice', _init);

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/admin/content-edit/preview-media-modal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../../tools';

registerFeature('admin_content_edit_preview_media_modal', _init);

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/admin/content-edit/preview-tag-type.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../../tools';

registerFeature('admin_content_edit_preview_tag_type', _init);

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/admin/content-edit/preview-toggle.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../../tools';

registerFeature('admin_content_edit_preview_toggle', _init);

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/admin/content-edit/site-filter-modules.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../../tools';

registerFeature('admin_content_edit_site_filter_modules', _init);

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/admin/content-edit/wysiwyg.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

import * as tinymce from 'tinymce/tinymce';
import {contentEditableUpdateInputsFromElement} from './contenteditable';
import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../../tools';

registerFeature('admin_content_edit_wysiwyg', _init);

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/admin/fields-visibility.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../tools';

registerFeature('admin_fields_visibility', _init);

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/admin/locales-widgets.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {addTargetEventListener, callForeachSelector, registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {addTargetEventListener, callForeachSelector, registerFeature} from '../tools';

registerFeature('admin_locales_widgets', _init);

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/admin/routes-forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as underscored from 'underscore.string/underscored';
import * as slugify from 'underscore.string/slugify';
import 'underscore.string/slugify';

import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../tools';

registerFeature('admin_routes_forms', _init);

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/types/block-type.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../tools';

registerFeature('types_block_type', _init);

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/types/color-type.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../tools';

registerFeature('types_color_type', _init);

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/types/symfony-route-type.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* See Softspring\Form\Type\SymfonyRouteType and
*/
import {registerFeature} from '@softspring/cms-bundle/scripts/tools';
import {registerFeature} from '../tools';

registerFeature('types_symfony_route_type', _init);

Expand Down
108 changes: 108 additions & 0 deletions assets/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
const Encore = require('@symfony/webpack-encore');

// Manually configure the runtime environment if not already configured yet by the "encore" command.
// It's useful when you use tools that rely on webpack.config.js file.
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}

Encore
// directory where compiled assets will be stored
//.setOutputPath('../public/')
.setOutputPath('dist/')
// public path used by the web server to access the output path
.setPublicPath('.')
// only needed for CDN's or sub-directory deploy
.setManifestKeyPrefix('')

/*
* ENTRY CONFIG
*
* Each entry will result in one JavaScript file (e.g. app.js)
* and one CSS file (e.g. app.css) if your JavaScript imports CSS.
*/
.addEntry('cms-bundle.min', './build-dist.js')

// enables the Symfony UX Stimulus bridge (used in assets/bootstrap.js)
//.enableStimulusBridge('./assets/controllers.json')

// When enabled, Webpack "splits" your files into smaller pieces for greater optimization.
// .splitEntryChunks()

// will require an extra script tag for runtime.js
// but, you probably want this, unless you're building a single-page app
// .enableSingleRuntimeChunk()
.disableSingleRuntimeChunk()

/*
* FEATURE CONFIG
*
* Enable & configure other features below. For a full
* list of features, see:
* https://symfony.com/doc/current/frontend.html#adding-more-features
*/
.cleanupOutputBeforeBuild()
.enableBuildNotifications()
//.enableSourceMaps(!Encore.isProduction())
// enables hashed filenames (e.g. app.abc123.css)
//.enableVersioning(Encore.isProduction())

// .configureBabel((config) => {
// config.plugins.push('@babel/plugin-proposal-class-properties');
// })

// // enables @babel/preset-env polyfills
// .configureBabelPresetEnv((config) => {
// config.useBuiltIns = 'usage';
// config.corejs = 3;
// })

// enables Sass/SCSS support
.enableSassLoader()

// .copyFiles({
// from: './assets/images',
// to: 'images/[path][name].[ext]',
// pattern: /\.(png|jpg|jpeg|gif|svg|json|ico|mp4|webm|ogv)$/
// })
// .copyFiles({
// from: './assets/fonts',
// to: 'fonts/[path][name].[ext]',
// pattern: /\.(eot|svg|ttf|woff)$/
// })


// copy tinymce's skin files
// .copyFiles({
// from: 'node_modules/tinymce',
// to: 'tinymce/[path]/[name].[ext]'
// })

// uncomment if you use TypeScript
//.enableTypeScriptLoader()

// uncomment if you use React
//.enableReactPreset()

// uncomment to get integrity="..." attributes on your script & link tags
// requires WebpackEncoreBundle 1.4 or higher
//.enableIntegrityHashes(Encore.isProduction())

// uncomment if you're having problems with a jQuery plugin
.autoProvidejQuery()

// this won't include jQuery and React in the output bundles generated
// by Webpack Encore. You'll need to load those dependencies yourself
// (e.g with a `<script>` tag) to make the application or website work.
.addExternals({
bootstrap: 'bootstrap',
bootstrap_icons: 'bootstrap-icons',
jquery: 'jQuery',
sfs_collection: '@softspring/collection-form-type',
sfs_media: '@softspring/media-bundle',
sfs_polymorphic: '@softspring/polymorphic-form-type',
tinymce: 'tinymce'
})
;

module.exports = Encore.getWebpackConfig();