Skip to content

Commit

Permalink
Merge pull request #84 from nysenate/feature/nys-19-33--ckeditor
Browse files Browse the repository at this point in the history
Update to CKEditor 5
  • Loading branch information
kzalewski authored Dec 22, 2023
2 parents 7c4d014 + efbdf50 commit dbffb10
Show file tree
Hide file tree
Showing 18 changed files with 293 additions and 115 deletions.
10 changes: 9 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"ext-json": "*",
"composer/installers": "^1.2",
"cweagans/composer-patches": "^1.7.0",
"dompdf/dompdf": "^2.0",
"drupal/address_map_link": "^1.3",
"drupal/admin_toolbar": "^3.0",
"drupal/ajax_comments": "^1.0@beta",
Expand Down Expand Up @@ -275,6 +276,7 @@
"2741877 - Nested modals don't work - fixed focal point preview modal": "https://www.drupal.org/files/issues/2021-04-29/2741877-77.patch",
"3049216 - ajax error": "https://www.drupal.org/files/issues/2023-01-31/3049216-21_0.patch",
"2794481 - Allow end date to be optional": "https://www.drupal.org/files/issues/2021-05-15/2794481-126.patch",
"3326778 - CKEditor5": "https://www.drupal.org/files/issues/2023-01-04/3326778-15.patch",
"3315678 - strnatcasecmp(): Passing null to parameter #2 ($string2) of type string is deprecated": "https://www.drupal.org/files/issues/2023-01-30/categorizing_plugin_error-3315678-16.patch"
},
"drupal/htmlpurifier": {
Expand Down Expand Up @@ -310,9 +312,15 @@
"Error while field storage definition\n": "https://www.drupal.org/files/issues/2022-10-19/contact_storage.patch",
"3191567 - Undefined index: entity:delete_action:contact_message": "https://www.drupal.org/files/issues/2022-11-07/contact_storage-bc_action_fix-3191567-31.patch"
},
"drupal/image_widget_crop":{
"drupal/image_widget_crop": {
"3153736 - Enforce hard limit": "https://www.drupal.org/files/issues/2020-06-22/3153736-2.patch",
"3214365 - Crop widget not adjusting crop box when crop is applied\nx": "https://www.drupal.org/files/issues/2021-06-09/crop_widget_not_adjusting_to_existing_crop-3214365-9.patch"
},
"drupal/entity_print": {
"3343982 - dompdf composer requirement update": "https://www.drupal.org/files/issues/2023-02-23/Dompdf-version-2.0.0-has-high-severity-vulenrabilities-3343982-2.patch"
},
"drupal/clamav": {
"3383653 -Support image upload plugin for CKEditor5\n": "https://git.drupalcode.org/project/clamav/-/merge_requests/7.patch"
}
}
}
Expand Down
1 change: 1 addition & 0 deletions config/sync/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module:
captcha: 0
charts: 0
ckeditor: 0
ckeditor5: 0
comment: 0
components: 0
conditional_fields: 0
Expand Down
95 changes: 56 additions & 39 deletions config/sync/editor.editor.basic_html.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,67 @@
uuid: 83ee00b3-907a-4c87-8a6a-35ee8bb58dd4
uuid: 792d6d7f-1141-4b23-8413-d4bee7d10b3c
langcode: en
status: true
dependencies:
config:
- filter.format.basic_html
module:
- ckeditor
_core:
default_config_hash: EELmeeGiE2IEA0VhcSxUCl_kqEPSC4AmztoziNVyO_8
- ckeditor5
format: basic_html
editor: ckeditor
editor: ckeditor5
settings:
toolbar:
rows:
-
-
name: Formatting
items:
- Bold
- Italic
-
name: Linking
items:
- DrupalLink
- DrupalUnlink
-
name: Lists
items:
- BulletedList
- NumberedList
-
name: Media
items:
- Blockquote
- DrupalImage
- DrupalMediaLibrary
-
name: 'Block Formatting'
items:
- Format
-
name: Tools
items:
- Source
items:
- bold
- italic
- '|'
- link
- '|'
- bulletedList
- numberedList
- '|'
- blockQuote
- drupalInsertImage
- drupalMedia
- '|'
- heading
- '|'
- sourceEditing
plugins:
drupallink:
ckeditor5_heading:
enabled_headings:
- heading2
- heading3
- heading4
- heading5
- heading6
ckeditor5_sourceEditing:
allowed_tags:
- '<cite>'
- '<dl>'
- '<dt>'
- '<dd>'
- '<span>'
- '<drupal-entity data-entity-type data-entity-uuid data-entity-substitution data-align data-caption>'
- '<div data-oembed-url>'
- '<blockquote cite>'
- '<ul type>'
- '<ol type>'
- '<h2 id>'
- '<h3 id>'
- '<h4 id>'
- '<h5 id>'
- '<h6 id>'
- '<img data-entity-substitution>'
- '<a hreflang accesskey id rel target title>'
- '<drupal-media title>'
ckeditor5_list:
reversed: false
startIndex: true
ckeditor5_imageResize:
allow_resize: true
media_media:
allow_view_mode_override: true
linkit_extension:
linkit_enabled: true
linkit_profile: default
image_upload:
Expand All @@ -53,5 +70,5 @@ image_upload:
directory: inline-images
max_size: ''
max_dimensions:
width: null
height: null
width: 0
height: 0
113 changes: 69 additions & 44 deletions config/sync/editor.editor.full_html.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,86 @@
uuid: 9317c15d-4fba-4ee5-9d0e-7a5ed73e5ab6
uuid: a1fc2ecc-2393-4b52-b4a9-9ae660f6ca9c
langcode: en
status: true
dependencies:
config:
- filter.format.full_html
module:
- ckeditor
_core:
default_config_hash: hmreJS472fteSsxIGuF6GJiR6kD1lvX2yZSv-KRJq1s
- ckeditor5
format: full_html
editor: ckeditor
editor: ckeditor5
settings:
toolbar:
rows:
-
items:
- bold
- italic
- '|'
- link
- '|'
- bulletedList
- numberedList
- outdent
- '|'
- drupalInsertImage
- drupalMedia
- '|'
- '|'
- insertTable
- horizontalLine
- sourceEditing
- '|'
- blockQuote
- heading
- style
plugins:
ckeditor5_heading:
enabled_headings:
- heading2
- heading3
- heading4
- heading5
- heading6
ckeditor5_style:
styles:
-
name: Formatting
items:
- Bold
- Italic
- '-'
label: 'More Link Left'
element: '<a class="c-paragraph--more-link a-left">'
-
name: Linking
items:
- DrupalLink
- DrupalUnlink
label: 'More Link Right'
element: '<a class="c-paragraph--more-link a-right">'
-
name: Lists
items:
- BulletedList
- NumberedList
- Outdent
label: 'Large Button Gold'
element: '<a class="nys-btn--gold">'
-
name: Media
items:
- DrupalImage
- DrupalMediaLibrary
label: 'Large Button Blue'
element: '<a class="nys-btn--blue">'
-
name: 'Block Formatting'
items:
- Format
label: 'Small Button Blue'
element: '<a class="c-btn--small-blue">'
-
name: Tools
items:
- Table
- HorizontalRule
- ShowBlocks
- Source
label: 'Paragraph No Space'
element: '<p class="nospace">'
-
name: Styles
items:
- Blockquote
- Styles
plugins:
stylescombo:
styles: "a.c-paragraph--more-link.a-left|More Link Left\r\na.c-paragraph--more-link.a-right|More Link Right\r\na.nys-btn--gold|Large Button Gold\r\na.nys-btn--blue|Large Button Blue\r\na.c-btn--small-blue|Small Button Blue\r\np.nospace|Paragraph No Space\r\nh2.c-container--h2-title|H2 Container\r\na.c-container--link|H2 Container Link\r\np.c-pullquote--citation|Quote Citation\r\nul.c-block--about-seal|List style\r\ndiv.c-block--background|Gray Text Box"
drupallink:
label: 'H2 Container'
element: '<h2 class="c-container--h2-title">'
-
label: 'H2 Container Link'
element: '<a class="c-container--link">'
-
label: 'List style'
element: '<ul class="c-block--about-seal">'
-
label: 'Gray Text Box'
element: '<div class="c-block--background">'
ckeditor5_sourceEditing:
allowed_tags: { }
ckeditor5_list:
reversed: true
startIndex: true
ckeditor5_imageResize:
allow_resize: true
media_media:
allow_view_mode_override: false
linkit_extension:
linkit_enabled: true
linkit_profile: default
image_upload:
Expand All @@ -64,5 +89,5 @@ image_upload:
directory: inline-images
max_size: ''
max_dimensions:
width: null
height: null
width: 0
height: 0
5 changes: 2 additions & 3 deletions config/sync/editor.editor.webform_default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ dependencies:
config:
- filter.format.webform_default
module:
- ckeditor
- webform
- ckeditor5
format: webform_default
editor: ckeditor
editor: ckeditor5
settings:
toolbar:
rows:
Expand Down
4 changes: 2 additions & 2 deletions config/sync/filter.format.basic_html.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ filters:
status: true
weight: -10
settings:
allowed_html: '<em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <p> <br> <span> <img src alt height width data-entity-type data-entity-uuid data-entity-substitution data-align data-caption> <drupal-entity data-entity-type data-entity-uuid data-entity-substitution data-align data-caption> <a href hreflang !href accesskey id rel target title data-entity-type data-entity-uuid data-entity-substitution> <div data-oembed-url> <drupal-media data-entity-type data-entity-uuid data-view-mode data-align data-caption alt title>'
allowed_html: '<br> <p> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <cite> <dl> <dt> <dd> <span> <drupal-entity data-entity-type data-entity-uuid data-entity-substitution data-align data-caption> <div data-oembed-url> <blockquote cite> <ul type> <ol type start> <img data-entity-substitution src alt height width data-entity-uuid data-entity-type data-caption data-align> <a hreflang accesskey id rel target title href data-entity-type data-entity-uuid data-entity-substitution> <drupal-media title data-entity-type data-entity-uuid alt data-view-mode data-caption data-align> <strong> <em> <li>'
filter_html_help: false
filter_html_nofollow: false
filter_align:
Expand Down Expand Up @@ -53,7 +53,7 @@ filters:
htmlpurifier:
id: htmlpurifier
provider: htmlpurifier
status: true
status: false
weight: 0
settings:
htmlpurifier_configuration: "Attr:\r\n AllowedClasses: null\r\n AllowedFrameTargets: { }\r\n AllowedRel: { }\r\n AllowedRev: { }\r\n ClassUseCDATA: null\r\n DefaultImageAlt: null\r\n DefaultInvalidImage: ''\r\n DefaultInvalidImageAlt: 'Invalid image'\r\n DefaultTextDir: ltr\r\n EnableID: false\r\n ForbiddenClasses: { }\r\n ID.HTML5: null\r\n IDBlacklist: { }\r\n IDBlacklistRegexp: null\r\n IDPrefix: ''\r\n IDPrefixLocal: ''\r\nAutoFormat:\r\n AutoParagraph: false\r\n Custom: { }\r\n DisplayLinkURI: false\r\n Linkify: false\r\n PurifierLinkify.DocURL: '#%s'\r\n PurifierLinkify: false\r\n RemoveEmpty.Predicate:\r\n colgroup: { }\r\n th: { }\r\n td: { }\r\n iframe:\r\n - src\r\n RemoveEmpty.RemoveNbsp.Exceptions:\r\n td: true\r\n th: true\r\n RemoveEmpty.RemoveNbsp: false\r\n RemoveEmpty: false\r\n RemoveSpansWithoutAttributes: false\r\nCSS:\r\n AllowDuplicates: false\r\n AllowImportant: false\r\n AllowTricky: false\r\n AllowedFonts: null\r\n AllowedProperties: null\r\n DefinitionRev: 1\r\n ForbiddenProperties: { }\r\n MaxImgLength: 1200px\r\n Proprietary: false\r\n Trusted: false\r\nCache:\r\n DefinitionImpl: Serializer\r\n SerializerPath: null\r\n SerializerPermissions: 493\r\nCore:\r\n AggressivelyFixLt: true\r\n AggressivelyRemoveScript: true\r\n AllowHostnameUnderscore: false\r\n AllowParseManyTags: false\r\n CollectErrors: false\r\n ColorKeywords:\r\n aliceblue: '#F0F8FF'\r\n antiquewhite: '#FAEBD7'\r\n aqua: '#00FFFF'\r\n aquamarine: '#7FFFD4'\r\n azure: '#F0FFFF'\r\n beige: '#F5F5DC'\r\n bisque: '#FFE4C4'\r\n black: '#000000'\r\n blanchedalmond: '#FFEBCD'\r\n blue: '#0000FF'\r\n blueviolet: '#8A2BE2'\r\n brown: '#A52A2A'\r\n burlywood: '#DEB887'\r\n cadetblue: '#5F9EA0'\r\n chartreuse: '#7FFF00'\r\n chocolate: '#D2691E'\r\n coral: '#FF7F50'\r\n cornflowerblue: '#6495ED'\r\n cornsilk: '#FFF8DC'\r\n crimson: '#DC143C'\r\n cyan: '#00FFFF'\r\n darkblue: '#00008B'\r\n darkcyan: '#008B8B'\r\n darkgoldenrod: '#B8860B'\r\n darkgray: '#A9A9A9'\r\n darkgrey: '#A9A9A9'\r\n darkgreen: '#006400'\r\n darkkhaki: '#BDB76B'\r\n darkmagenta: '#8B008B'\r\n darkolivegreen: '#556B2F'\r\n darkorange: '#FF8C00'\r\n darkorchid: '#9932CC'\r\n darkred: '#8B0000'\r\n darksalmon: '#E9967A'\r\n darkseagreen: '#8FBC8F'\r\n darkslateblue: '#483D8B'\r\n darkslategray: '#2F4F4F'\r\n darkslategrey: '#2F4F4F'\r\n darkturquoise: '#00CED1'\r\n darkviolet: '#9400D3'\r\n deeppink: '#FF1493'\r\n deepskyblue: '#00BFFF'\r\n dimgray: '#696969'\r\n dimgrey: '#696969'\r\n dodgerblue: '#1E90FF'\r\n firebrick: '#B22222'\r\n floralwhite: '#FFFAF0'\r\n forestgreen: '#228B22'\r\n fuchsia: '#FF00FF'\r\n gainsboro: '#DCDCDC'\r\n ghostwhite: '#F8F8FF'\r\n gold: '#FFD700'\r\n goldenrod: '#DAA520'\r\n gray: '#808080'\r\n grey: '#808080'\r\n green: '#008000'\r\n greenyellow: '#ADFF2F'\r\n honeydew: '#F0FFF0'\r\n hotpink: '#FF69B4'\r\n indianred: '#CD5C5C'\r\n indigo: '#4B0082'\r\n ivory: '#FFFFF0'\r\n khaki: '#F0E68C'\r\n lavender: '#E6E6FA'\r\n lavenderblush: '#FFF0F5'\r\n lawngreen: '#7CFC00'\r\n lemonchiffon: '#FFFACD'\r\n lightblue: '#ADD8E6'\r\n lightcoral: '#F08080'\r\n lightcyan: '#E0FFFF'\r\n lightgoldenrodyellow: '#FAFAD2'\r\n lightgray: '#D3D3D3'\r\n lightgrey: '#D3D3D3'\r\n lightgreen: '#90EE90'\r\n lightpink: '#FFB6C1'\r\n lightsalmon: '#FFA07A'\r\n lightseagreen: '#20B2AA'\r\n lightskyblue: '#87CEFA'\r\n lightslategray: '#778899'\r\n lightslategrey: '#778899'\r\n lightsteelblue: '#B0C4DE'\r\n lightyellow: '#FFFFE0'\r\n lime: '#00FF00'\r\n limegreen: '#32CD32'\r\n linen: '#FAF0E6'\r\n magenta: '#FF00FF'\r\n maroon: '#800000'\r\n mediumaquamarine: '#66CDAA'\r\n mediumblue: '#0000CD'\r\n mediumorchid: '#BA55D3'\r\n mediumpurple: '#9370DB'\r\n mediumseagreen: '#3CB371'\r\n mediumslateblue: '#7B68EE'\r\n mediumspringgreen: '#00FA9A'\r\n mediumturquoise: '#48D1CC'\r\n mediumvioletred: '#C71585'\r\n midnightblue: '#191970'\r\n mintcream: '#F5FFFA'\r\n mistyrose: '#FFE4E1'\r\n moccasin: '#FFE4B5'\r\n navajowhite: '#FFDEAD'\r\n navy: '#000080'\r\n oldlace: '#FDF5E6'\r\n olive: '#808000'\r\n olivedrab: '#6B8E23'\r\n orange: '#FFA500'\r\n orangered: '#FF4500'\r\n orchid: '#DA70D6'\r\n palegoldenrod: '#EEE8AA'\r\n palegreen: '#98FB98'\r\n paleturquoise: '#AFEEEE'\r\n palevioletred: '#DB7093'\r\n papayawhip: '#FFEFD5'\r\n peachpuff: '#FFDAB9'\r\n peru: '#CD853F'\r\n pink: '#FFC0CB'\r\n plum: '#DDA0DD'\r\n powderblue: '#B0E0E6'\r\n purple: '#800080'\r\n rebeccapurple: '#663399'\r\n red: '#FF0000'\r\n rosybrown: '#BC8F8F'\r\n royalblue: '#4169E1'\r\n saddlebrown: '#8B4513'\r\n salmon: '#FA8072'\r\n sandybrown: '#F4A460'\r\n seagreen: '#2E8B57'\r\n seashell: '#FFF5EE'\r\n sienna: '#A0522D'\r\n silver: '#C0C0C0'\r\n skyblue: '#87CEEB'\r\n slateblue: '#6A5ACD'\r\n slategray: '#708090'\r\n slategrey: '#708090'\r\n snow: '#FFFAFA'\r\n springgreen: '#00FF7F'\r\n steelblue: '#4682B4'\r\n tan: '#D2B48C'\r\n teal: '#008080'\r\n thistle: '#D8BFD8'\r\n tomato: '#FF6347'\r\n turquoise: '#40E0D0'\r\n violet: '#EE82EE'\r\n wheat: '#F5DEB3'\r\n white: '#FFFFFF'\r\n whitesmoke: '#F5F5F5'\r\n yellow: '#FFFF00'\r\n yellowgreen: '#9ACD32'\r\n ConvertDocumentToFragment: true\r\n DirectLexLineNumberSyncInterval: 0\r\n DisableExcludes: false\r\n EnableIDNA: false\r\n Encoding: utf-8\r\n EscapeInvalidChildren: false\r\n EscapeInvalidTags: false\r\n EscapeNonASCIICharacters: false\r\n HiddenElements:\r\n script: true\r\n style: true\r\n Language: en\r\n LegacyEntityDecoder: false\r\n LexerImpl: null\r\n MaintainLineNumbers: null\r\n NormalizeNewlines: true\r\n RemoveInvalidImg: true\r\n RemoveProcessingInstructions: false\r\n RemoveScriptContents: null\r\nFilter:\r\n Custom: { }\r\n ExtractStyleBlocks.Escaping: true\r\n ExtractStyleBlocks.Scope: null\r\n ExtractStyleBlocks.TidyImpl: null\r\n ExtractStyleBlocks: false\r\n YouTube: false\r\nHTML:\r\n Allowed: null\r\n AllowedAttributes: null\r\n AllowedComments: { }\r\n AllowedCommentsRegexp: null\r\n AllowedElements: null\r\n AllowedModules: null\r\n Attr.Name.UseCDATA: false\r\n BlockWrapper: p\r\n CoreModules:\r\n Structure: true\r\n Text: true\r\n Hypertext: true\r\n List: true\r\n NonXMLCommonAttributes: true\r\n XMLCommonAttributes: true\r\n CommonAttributes: true\r\n CustomDoctype: null\r\n DefinitionID: null\r\n DefinitionRev: 1\r\n Doctype: null\r\n FlashAllowFullScreen: false\r\n ForbiddenAttributes: { }\r\n ForbiddenElements: { }\r\n Forms: false\r\n MaxImgLength: 1200\r\n Nofollow: false\r\n Parent: div\r\n Proprietary: false\r\n SafeEmbed: false\r\n SafeIframe: false\r\n SafeObject: false\r\n SafeScripting: { }\r\n Strict: false\r\n TargetBlank: false\r\n TargetNoopener: true\r\n TargetNoreferrer: true\r\n TidyAdd: { }\r\n TidyLevel: medium\r\n TidyRemove: { }\r\n Trusted: false\r\n XHTML: true\r\nOutput:\r\n CommentScriptContents: true\r\n FixInnerHTML: true\r\n FlashCompat: false\r\n Newline: null\r\n SortAttr: false\r\n TidyFormat: false\r\nTest:\r\n ForceNoIconv: false\r\nURI:\r\n AllowedSchemes:\r\n http: true\r\n https: true\r\n mailto: true\r\n ftp: true\r\n nntp: true\r\n news: true\r\n tel: true\r\n Base: null\r\n DefaultScheme: http\r\n DefinitionID: null\r\n DefinitionRev: 1\r\n Disable: false\r\n DisableExternal: false\r\n DisableExternalResources: false\r\n DisableResources: false\r\n Host: null\r\n HostBlacklist: { }\r\n MakeAbsolute: false\r\n Munge: null\r\n MungeResources: false\r\n MungeSecretKey: null\r\n OverrideAllowedSchemes: true\r\n SafeIframeRegexp: null\r\n"
Expand Down
Loading

0 comments on commit dbffb10

Please sign in to comment.