github getkirby/kirby 3.6.2

latest releases: 5.0.0-alpha.3, 4.4.1, 4.4.0...
2 years ago

🎉 Features

New date & time fields

The date and time fields have been a constant struggle in the past. We dedicated this release to fix various bugs and enhance the overall look and UX of those fields. Smart input parsing supports various date formats while writing or pasting dates. Navigate through parts of a date or time with tab and modify year, month, day, hour, minute and second with arrow keys. Combined with a new time dropdown, full support for am/pm, various display options and other features, the new fields are a major step ahead.

dates.mp4

Alternate stylesheet support

You can now add rel="alternate stylesheet" in the css() helper #4099

css('assets/css/index.css', ['rel' => 'alternate stylesheet', 'title' => 'High contrast']);

New markdown safe mode

The markdown parser now supports a safe mode, which escapes any custom HTML, while still parsing markdown correctly. Safe mode can now be enabled like this:

// helpers
kirbytext($text, [
  'markdown' => [
    'safe' => true
  ]
]);

kirbytextInline($text, [
  'markdown' => [
    'safe' => true
  ]
]);

markdown($text, [
   'safe' => true
]);

// field methods
$page->text()->kirbytext([
  'markdown' => [
    'safe' => true
  ]
]);

$page->text()->kirbytextInline([
  'markdown' => [
    'safe' => true
  ]
]);

$page->text()->markdown([
   'safe' => true
]);

The safe mode is now also available as global markdown setting:

<?php

// config.php
return [
  'markdown' => [
    'safe' => true
  ]
];

New Fiber dialog features

There are new options to define custom submit and cancel handlers for Fiber dialogs

// short version
this.$dialog('some/dialog', ({ dialog, value }) => { 
  // custom submit handler 
});

// in options
this.$dialog('some/dialog', {
  cancel: () => {
    // custom cancel handler
  },
  submit: ({ dialog, value }) => { 
    // custom submit handler 
  }
});

Dialogs can now also be defined synchronously instead of loading them from the server.

this.$dialog({
  component: 'k-remove-dialog', 
  props: {
    text: 'Do you really want to delete this entry?'
  },
  cancel: () => {
    // custom cancel handler
  },
  submit: ({ dialog, value }) => { 
    // custom submit handler 
  }
});

New Kirby\Toolkit\Date class #4040

  • extension for PHP's DateTime class
  • helps with all kinds of date and time related tasks
  • is now used by our date and time fields and the timestamp() helper
  • New iso plugin for dayjs to parse and format ISO date/time/datetime strings

New slug transliteration rules for Inuktitut syllabics

Thanks to @PaulMorel for his support: #4091

✨Enhancements

  • Add missing locale parameter to Cms\File::niceSize, Cms\Files::niceSize() and Filesystem\Dir::niceSize() #4045
  • Adds several dayjs plugins for handle logic that we will need for refactoring the dates and time fields #4036:
    • a.merge(n, "time"): merges a defined part (date or time) of dayjs object b into dayjs object a
    • dayjs.pattern('YYYY-MM-DD"): class that supports analysing and interpreting a specific dayjs format pattern
    • dayjs.round("minute", 5): method to round current dayjs object to nearest step (unit and size)
    • dayjs.units(is12h): a map between units and dayjs tokens given 12/24h clock
    • dayjs.validate(): helper to validate a current dayjs object against a min/max boundary
    • `dayjs.interpret('12.02.2020'): to convert an array of date input formats to a dayjs object
  • The JSON unexpected error message is now translatable #4081
  • New this.$fiber global in Vue
  • Shell arguments that get passed to ImageMagick are now individually escaped #4109

🐛 Fixes

  • Various date and time field fixes
    • Fix computed separator in date field #3946
    • Improved input rules
    • Better tabbing
    • Fixed typing issues
    • Dozens of unit and e2e tests
    • Fixed display of date & time in narrow columns
    • Fixed previews for time and date fields in structures
    • Fixed CSS for the date field to wrap more reliably #4118
    • The calendar dropdown of date fields closes properly inside a structure field when focussing another field
    • Date field value gets properly saved inside structure fields when hitting Cmd+S
    • Fixed issue when only displaying year in date field
    • Fixed issue with storing seconds in date/time fields
    • Fixed timezone handling, removed introduction of UTC timezone pinning
    • Throws proper error when passing not an object as step prop to inputs
  • Avoid gender star issues with italic markdown shortcuts #4112
  • Fixed passing null to parameter to is_file() function in Tpl::load() method on PHP 8.1 #4032
  • No longer throws deprecation warning passing null to Str functions
  • No longer throws deprecation warning implicit float to int conversion when scaling dimensions for an SVG
  • Creating the user no longer collides with the content language in multi-language setups #4050
  • Fixed calling url() helper throws deprecation warning with PHP 8.1 #4047
  • Enabling link in pages, files and users fields works correctly again #4062
  • Fixed changing slug with unsaved changes leads to Panel error #4006
  • Fixed selected tab when switching languages #4071
  • Fixed image back option with html color names that start with 'light' don't apply #4073
  • Fixed $page->prevUnlisted() returns wrong collection item #4086
  • Fixed redirects in fetch requests to non-fiber resources: #4084
  • No longer uses POST requests for dropdowns: #4083
  • Fixed z-index issue for in dropdowns #4072
  • Fixed string type check warning in Page::findById() in PHP 8.1 #4119
  • Fixed passing null parameters in YAML parser to avoid deprecation warnings in PHP 8.1
  • panel.favicon option now supports single string as value
return [
  'panel' => [
    'favicon' => 'assets/favicon.ico'
  ]
];

♻️ Refactoring

  • Explicit CSS data attr selectors for styling #4027
  • We now use https://vitest.dev for JS unit tests #4064
    • CI integration
    • First component tests #4069
    • Tweaks for $helpers and their unit tests #4057
  • We use more PHP 7.4 arrow functions where it makes sense #4028
  • Update composer.json to Composer API 2.2 #4066
  • Refactored Fiber class for better testability and added additional unit tests
  • Removed outdated wait-on dependency #4094
  • Refactored Spyc YAML parser
    • Removed mustangostang/spyc repository from composer
    • Moved Spyc class into /dependencies
    • Removed spyc_load(), spyc_load_file(), spyc_dump() functions
    • Removed enabling from command line
    • Added more PHP unit tests

📈 Stats

  • 253 commits
  • 69 closed issues and PRs

👨‍💻 Contributors

(in alphabetical order)

Don't miss a new kirby release

NewReleases is sending notifications on new releases.