Skip to content

Commit

Permalink
minor v17.01
Browse files Browse the repository at this point in the history
  • Loading branch information
iJungleboy committed Jan 18, 2024
1 parent 8cf0aec commit 167650e
Show file tree
Hide file tree
Showing 42 changed files with 710 additions and 276 deletions.
2 changes: 1 addition & 1 deletion 2sxc Docs Generator/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<img src="assets/logos/vcurrent/500.png" width="250px" align="right" class="float-end">

# 2sxc and EAV Docs v17.00
# 2sxc and EAV Docs v17.01

This is the technical documentation for EAV and 2sxc. If you're new to 2sxc, start with [2sxc.org](https://2sxc.org/).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ This page collects all the changes of all versions into one place, making it eas

---

[!include["All"](./v17/_all.md)]

---

[!include["All"](./v16/_all.md)]

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ We're documenting it here to ensure you know what happened, in case you still ru

---

[!include["Breaking Changes"](./v17/_brc.md)]

---

[!include["Breaking Changes"](./v16/_brc.md)]

---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

## Version 17

<!-- [!include["Changes"](./_changes16.00.md)] -->
[!include["Changes"](./_changes17.00.md)]

<!-- [!include["Changes"](./_changes16.01.md)] -->
24 changes: 24 additions & 0 deletions 2sxc Docs Generator/pages/abyss/releases/history/v17/_brc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@


## Breaking Changes in EAV and 2sxc v17

We try to minimize breaking changes, and most breaking changes won't affect your work, because it's internal API.
We're documenting it here to ensure you know what happened, in case you still run into this.

### Summary

TODO:

#### v17.00

TODO:

1. `ToSic.Eav.App.AppData` is renamed to `ToSic.Eav.Apps.DataSources.AppDataWithCrud`
1. In Typed mode, the `App.Data` now has a different interface `ToSic.Sxc.Apps.IAppDataTyped`
1. `AppState` changes...
1. `App` object had a hidden `AppState` property which was never documented and is now removed.
If you were using it, then probably to access `GetContentType(string)`. You can find a replacement on `App.Data.GetContentType(...)`.

---

Shortlink: <https://go.2sxc.org/brc-17>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Planned Removals for 2sxc v17
## Planned Removals for 2sxc v17

For 2sxc 17 we plan to remove some very old APIs.
The process is as follows:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

### Changes in 2sxc 17.00 LTS (2023-12-23)


1. ✅ DNN: Require CodeDome C# 7.3 to be installed
1. ✅ Docs infrastructure can now be multi-versioned
1. ✅ Show app icon in admin UI
1. ✅ Ctrl+Click on toolbar buttons to open in new tab
1. ✅ Completely refactor internal APIs to do advanced work and save data
1. ✅ Change UI to use Angular 17 (from Angular 14)
1. ✅ Get intellisense to work in VS Code
1. ✅ Work out best way to do this in VS Code
1. ✅ Work out best way to hide non-public APIs
1. ✅ Work out best way to include docs (xml files, nuget, etc.)
1. ✅ Support C# 7.3 in DNN with warning if not installed
1. ✅ System Capabilities Framework for tagging apps which need certain technologies/features
1. ✅ Crazy new compiled typed _shared_ code `/ThisApp/Code` - see [Hot App Code](xref:Guides.HotBuild.Index)
1. ✅ New APIs on Typed Code
1. `IsPublished`
1. `Publishing`
- `Publishing.HasPublished`, `Publishing.HasUnpublished`, `Publishing.HasBoth`
- `Publishing.GetPublished()`, `Publishing.GetUnpublished()`, `Publishing.GetOpposite()`
15 changes: 3 additions & 12 deletions 2sxc Docs Generator/pages/abyss/releases/history/v17/breaking.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,10 @@
uid: Abyss.Releases.History.V17.Breaking
---

# Planned Breaking Changes in EAV and 2sxc 17
# Breaking Changes in EAV and 2sxc v17

[!include["Breaking Changes"](./_brc17-planned.md)]


TODO:
[!include["Breaking Changes"](./_brc.md)]

1. `ToSic.Eav.App.AppData` is renamed to `ToSic.Eav.Apps.DataSources.AppDataWithCrud`
1. In Typed mode, the `App.Data` now has a different interface `ToSic.Sxc.Apps.IAppDataTyped`
1. `AppState` changes...
1. `App` object had a hidden `AppState` property which was never documented and is now removed.
If you were using it, then probably to access `GetContentType(string)`. You can find a replacement on `App.Data.GetContentType(...)`.

---
[!include["Breaking Changes"](./_brc17-planned.md)]

Shortlink: <https://go.2sxc.org/brc-17>
41 changes: 14 additions & 27 deletions 2sxc Docs Generator/pages/abyss/releases/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,33 @@ And sometimes a customer will need a feature quickly - and pay for it - then it
Last Update: **2023-11-23**

## Currently being developed v17 2023-Q4

1. ✅ DNN: Require CodeDome C# 7.3 to be installed
1. ✅ Docs infrastructure can now be multi-versioned
1. ✅ Show app icon in admin UI
1. ✅ Ctrl+Click on toolbar buttons to open in new tab
1. ✅ Completely refactor internal APIs to do advanced work and save data
1. ✅ Change UI to use Angular 17 (from Angular 14)
1. ✅ Get intellisense to work in VS Code
1. ✅ Work out best way to do this in VS Code
1. ✅ Work out best way to hide non-public APIs
1. ✅ Work out best way to include docs (xml files, nuget, etc.)
1. ✅ Support C# 7.3 in DNN with warning if not installed
1. ✅ System Capabilities Framework for tagging apps which need certain technologies/features
1. ✅ Crazy new compiled typed _shared_ code `/ThisApp/Code` - see [Hot App Code](xref:Guides.HotBuild.Index)
1. ✅ New APIs on Typed Code
1. `IsPublished`
1. `Publishing`
- `Publishing.HasPublished`, `Publishing.HasUnpublished`, `Publishing.HasBoth`
- `Publishing.GetPublished()`, `Publishing.GetUnpublished()`, `Publishing.GetOpposite()`
## TODO: add infos from release 17.01

## To Improve Q1

1. ⌛ Mobius Form Builder
1. Improve Intellisense
1. Hide more internal APIs
1. Hide more internal APIs
1. Include more XML docs
1. ✅ ToSic.Sxc
1. ToSic.Sxc.WebApi
1. ToSic.Sxc.Dnn
1. ToSic.Sxc.Oqt / Razor
1. Find way to link to the official docs from inside the help
1. Improve HotBuild
1. ⌛ Improve initial list of included assemblies and namespaces @STV
1. Improve caching of information how to build/compile to improve speed
1. ⌛ Add support for sub-folders
1. Support Editions
1. ✅ Improve initial list of included assemblies and namespaces @STV
1. ✅ Improve caching of information how to build/compile to improve speed
1. ✅ Add support for sub-folders
1. ✅ Support Editions
1. ✅ Improve error messages on building the ThisCode folder
1. ✅ Improve error messages when building Razor and C# using Roslyn
1. Improve detection so that build is locking (prevent multiple builds on high-load)
1. Provide special UI to build the code and debug
1. Improve error messages on building the ThisCode folder
1. Improve error messages when building Razor and C# using Roslyn
1. Shared Field Configurations (not yet "published")
1. ✅ Ability to change input config types/metadata - eg. skip `@String` when never needed
1. ✅ Ability to share field configurations
1. ⌛ Custom config inherit from multiple sources or keeping the Label
1. Preserve config on export/import
1. ⌛ Document new ~~Pro~~ Typed mode


Expand Down
8 changes: 3 additions & 5 deletions 2sxc Docs Generator/pages/js-code/commands/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,13 @@ To activate these features manually just use the [IPageService](xref:NetCode.Raz



## How to use (v13.03)
## How to use (v14+)

Simple example:

```razor
@{
// enable editing for all users
GetService<ToSic.Sxc.Services.IPageService>().Activate("2sxc.JsCms");
}
@* enable editing for all users *@
@Kit.Page.Activate("2sxc.JsCms")
<script>
// Run the command and handle the returned promise
Expand Down
5 changes: 2 additions & 3 deletions 2sxc Docs Generator/pages/js-code/turn-on/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ $(start);

To use turnOn you must must tell the page that you need it. Here's how:

```c#
var page = GetService<ToSic.Sxc.Services.IPageService>();
page.Activate("turnOn");
```razor
@Kit.Page.Activate("turnOn");
```

👉 Read more about the [IPageService](xref:NetCode.Razor.Services.IPageService)
Expand Down
6 changes: 2 additions & 4 deletions 2sxc Docs Generator/pages/net-code/features/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,15 @@ This example is taken from [Mobius Forms](xref:App.Mobius) and the code can be f

```cs
@{
var feats = GetService<ToSic.Sxc.Services.IFeaturesService>();

// show warning if the save-attachments in web api isn't activated
if(!feats.IsEnabled("SaveInAdamApi")) {
if(!Kit.Feature.IsEnabled("SaveInAdamApi")) {
<div class="alert alert-warning">
Warning: file upload won't work yet, as it hasn't been enabled.
</div>
}

// Show warning if any of the following features are not enabled
if(!feats.IsEnabled("PublicEditForm", "PublicUploadFiles")) {
if(!Kit.Feature.IsEnabled("PublicEditForm", "PublicUploadFiles")) {
<div class="alert alert-warning">
Warning: Edit Form and file upload have not been enabled.
</div>
Expand Down
65 changes: 28 additions & 37 deletions 2sxc Docs Generator/pages/net-code/images/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ uid: NetCode.Images.Index
---
# Responsive Images API in .net

Creating perfect responsive images can be really hard.
Creating perfect responsive images can be really hard.


Aspects which are covered
Expand All @@ -16,12 +16,7 @@ Aspects which are covered
## Example

```razor
@using ToSic.Sxc.Services;
@{
var imgService = GetService<IImageService>();
var blogPic = imgService.Picture(blogPost.Image);
}
@blogPic
@Kit.Image.Picture(blogPost.Image)
```

TODO: LINK TO EXAMPLES
Expand All @@ -41,25 +36,21 @@ Internally this is what will happen:

Always start by getting the [](xref:ToSic.Sxc.Services.IImageService) - you will usually just get this once per Razor template:

```c#
var imgService = GetService<ToSic.Sxc.Services.IImageService>();
```

If needed, prepare resize settings using the [ResizeSettings(...)](xref:ToSic.Sxc.Services.IImageService.Settings*).
If needed, prepare resize settings using the [ResizeSettings(...)](xref:ToSic.Sxc.Services.IImageService.Settings*).
This is probably only needed in ca. 10% of all cases, because the defaults are usually what you want to use.
If you want to do this, see further explanations further down.
If you want to do this, see further explanations further down.

### 2. Get the Responsive Object

Get the responsive [Image](xref:ToSic.Sxc.Images.IResponsiveImage) or [Picture](xref:ToSic.Sxc.Images.IResponsivePicture)
Get the responsive [Image](xref:ToSic.Sxc.Images.IResponsiveImage) or [Picture](xref:ToSic.Sxc.Images.IResponsivePicture)
using the [Img(...)](xref:ToSic.Sxc.Services.IImageService.Img*) or [Picture(...)](xref:ToSic.Sxc.Services.IImageService.Picture*).

```c#
// Example for a file in the App folder
var appIconImg = imgService.Img(App.Path + "/app-icon.png");
var appIconPicture = imgService.Picture(App.Path + "/app-icon.png");
var appIconImg = Kit.Image.Img(App.Path + "/app-icon.png");
var appIconPicture = Kit.Image.Picture(App.Path + "/app-icon.png");
// Example for an image on a dynamic-data object
var blogPicImg = imgService.Img(blogPost.Image);
var blogPicImg = Kit.Image.Img(blogPost.Image);
```

### 3. Output
Expand All @@ -77,47 +68,47 @@ When creating the HTML you have many options. The most basic is just to show the

If no settings are provided, the `Settings.Images.Content` [see settings](xref:Basics.Configuration.SettingsSystem) will be used automatically.

The most common scenario is that you have a razor template which shows images that are typically half or a third the size of the normal content.
The most common scenario is that you have a razor template which shows images that are typically half or a third the size of the normal content.
In such a case you would also supply a factor in various possible formats.
Here some examples:

```c#
var blogPicImgHalf = imgService.Img(blogPost.Image, factor: 0.5);
var blogPicImgThird = imgService.Img(blogPost.Image, factor: "1/3");
var blogPicImg2Thirds = imgService.Img(blogPost.Image, factor: "2:3");
var blogPicImgHalf = Kit.Image.Img(blogPost.Image, factor: 0.5);
var blogPicImgThird = Kit.Image.Img(blogPost.Image, factor: "1/3");
var blogPicImg2Thirds = Kit.Image.Img(blogPost.Image, factor: "2:3");
```

You can also use other settings, like `Settings.Images.Screen` for larger settings.
This can also be combined with factor - here's an example:

```c#
var background = imgService.Img(blogPost.Image, settings: Settings.Images.Screen);
var backgroundSmaller = imgService.Img(blogPost.Image, settings: Settings.Images.Screen, factor: 0.9);
var background = Kit.Image.Img(blogPost.Image, settings: Settings.Images.Screen);
var backgroundSmaller = Kit.Image.Img(blogPost.Image, settings: Settings.Images.Screen, factor: 0.9);
```

You can also use custom settings like this:

```c#
var resizeSettings = imgService.ResizeSettings(width: 1000, quality: 75, aspectRatio: "16/9");
var img = imgService.Img(blogPost.Image, settings: resizeSettings);
var resizeSettings = Kit.Image.ResizeSettings(width: 1000, quality: 75, aspectRatio: "16/9");
var img = Kit.Image.Img(blogPost.Image, settings: resizeSettings);
```

And you can merge standard settings with your custom settings like this:

```c#
var resizeSettings = imgService.ResizeSettings(settings: Settings.Images.Custom, width: 1000, quality: 75, aspectRatio: "16/9");
var img = imgService.Img(blogPost.Image, settings: resizeSettings);
var resizeSettings = Kit.Image.ResizeSettings(settings: Settings.Images.Custom, width: 1000, quality: 75, aspectRatio: "16/9");
var img = Kit.Image.Img(blogPost.Image, settings: resizeSettings);
```

### Image `alt` Description or `class` Attribute

These are the most common things you may want to specify, so the `Img(...)` and `Picture(...)` tag support this in the initial call:

```c#
var img = imgService.Img(blogPost.Image, imgAlt: blogPost.Title, imgClass: "some-class-names");
var img = Kit.Image.Img(blogPost.Image, imgAlt: blogPost.Title, imgClass: "some-class-names");
```

Other attributes can be set as well, but it's more complicated. See custom Output below.
Other attributes can be set as well, but it's more complicated. See custom Output below.


### Custom Output
Expand All @@ -126,22 +117,22 @@ In most cases you'll just want to show the image or picture, like this:

```razor
@{
var img = imgService.Img(blogPost.Image);
var picture = imgService.Picture(blogPost.Image);
var img = Kit.Image.Img(blogPost.Image);
var picture = Kit.Image.Picture(blogPost.Image);
}
@* Now just show them *@
@img
@picture
```

But you may need to customize more what the output shows.
But you may need to customize more what the output shows.
Let's assume you want to give the `<img>` and `<picture>` tag a special `id` here's what you would do:

```razor
@{
var img = imgService.Img(blogPost.Image);
var img = Kit.Image.Img(blogPost.Image);
img.ImgTag.Id("mainImg");
var picture = imgService.Picture(blogPost.Image);
var picture = Kit.Image.Picture(blogPost.Image);
picture.ImgTag.Id("mainImg");
picture.PictureTag.Id("mainPic");
}
Expand All @@ -150,16 +141,16 @@ Let's assume you want to give the `<img>` and `<picture>` tag a special `id` her
@picture
```

The img and picture variables are [](xref:ToSic.Sxc.Images.IResponsiveImage) and [](xref:ToSic.Sxc.Images.IResponsivePicture) objects.
The img and picture variables are [](xref:ToSic.Sxc.Images.IResponsiveImage) and [](xref:ToSic.Sxc.Images.IResponsivePicture) objects.

The `ImgTag` and `PictureTag` properties are [RazorBlade](xref:NetCode.RazorBlade.Index) objects and can be customized using the RazorBlade fluid Tag API.

In case you want even more control over your output, you can also piece it together yourself:

```razor
@{
var img = imgService.Img(blogPost.Image);
var picture = imgService.Picture(blogPost.Image);
var img = Kit.Image.Img(blogPost.Image);
var picture = Kit.Image.Picture(blogPost.Image);
}
@* Show the Image with some custom changes *@
@img.Id("imgId").Style("width: 33%")
Expand Down
Loading

0 comments on commit 167650e

Please sign in to comment.