github getkirby/kirby 3.6.2-rc.1

latest releases: 4.5.0-rc.1, 5.0.0-alpha.3, 4.4.1...
pre-release2 years ago

🎉 Features

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

✨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
  • Frontend tests with Vitest #4064
  • The JSON unexpected error message is now translatable #4081
  • First component tests #4069
  • New this.$fiber global in Vue
  • Unit tests for all main Fiber parts

🐛 Fixes

  • Various date and time field fixes
    • Fix computed separator in date field #3946
  • 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
  • Date field value gets properly saved inside structure fields when hitting Cmd+S
  • Calendar dropdown of date fields closes properly inside a structure field when focussing another field
  • Throws proper error when passing not an object as step prop to inputs
  • 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
  • panel.favicon option now supports single string as value
return [
  'panel' => [
    'favicon' => 'assets/favicon.ico'
  ]
];
  • Fixed passing null parameters in YAML parser to avoid deprecation warnings in PHP 8.1

♻️ Refactoring

  • Explicit CSS data attr selectors for styling #4027
  • Use https://vitest.dev for JS unit tests #4064
  • Use more PHP arrow functions where it makes sense #4028
  • Tweaks for $helpers and their unit tests #4057
  • Update composer.json to Composer API 2.2 #4066
  • Refactored Fiber class for better testability
  • 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

Don't miss a new kirby release

NewReleases is sending notifications on new releases.