diff --git a/docs/Notes/updates.md b/docs/Notes/updates.md index e36b796ca5ce22..f520d07c2a4bad 100644 --- a/docs/Notes/updates.md +++ b/docs/Notes/updates.md @@ -9,6 +9,7 @@ Read [**What’s new in 4D 21 R4**](https://blog.4d.com/whats-new-in-4d-21-r4/), #### Highlights +- Multi-level list style sheets are now [supported in 4D Write Pro Interface](../WritePro/writeprointerface.md#multi-level-style-sheets), allowing users to create and manage structured multi-level lists directly from the toolbar and sidebar. - New [`defer`](../commands/defer) command to declare some code to be always executed at method or function exit; new [`Deferred formulas`](../commands/deferred-formulas) command to get the list of deferred formulas. @@ -20,7 +21,7 @@ Read [**What’s new in 4D 21 R3**](https://blog.4d.com/whats-new-in-4d-21-r3/), #### Highlights - The [`JSON Validate`](../commands/json-validate) command now supports of JSON Schema draft 2020-12. -- 4D Write Pro now supports [hierarchical list style sheets](../WritePro/user-legacy/stylesheets.md#hierarchical-list-style-sheets), enabling the creation and management of structured [multi-level lists](../WritePro/user-legacy/using-a-4d-write-pro-area.md#multi-level-lists) with automatic numbering. +- 4D Write Pro now supports [multi-level list style sheets](../WritePro/user-legacy/stylesheets.md#multi-level-list-style-sheets), enabling the creation and management of structured [multi-level lists](../WritePro/user-legacy/using-a-4d-write-pro-area.md#multi-level-lists) with automatic numbering. - Ability to use a custom certificate from the macOS keychain instead of a local certificates folder in [`HTTPRequest`](../API/HTTPRequestClass.md#4dhttprequestnew) and [`HTTPAgent`](../API/HTTPAgentClass.md#4dhttpagentnew) classes. - New [`4D.Method` class](../API/MethodClass.md) to create and execute a 4D method code from text source. [`METHOD Get path`](../commands/method-get-path) and [`METHOD RESOLVE PATH`](../commands/method-resolve-path) commands support a new `path volatile method` constant (128). - IMAP transporter now supports mailbox event notifications using the IDLE protocol through a [notifier object](../API/IMAPTransporterClass.md#notifier) of the [4D.IMAPNotifier](../API/IMAPNotifierClass.md) class, configurable via the `listener` property of [IMAP New transporter](../commands/imap-new-transporter). diff --git a/docs/WritePro/user/user-new.md b/docs/WritePro/user/user-new.md index 77f1d00da79f72..c2067f89624448 100644 --- a/docs/WritePro/user/user-new.md +++ b/docs/WritePro/user/user-new.md @@ -10,7 +10,7 @@ to import ## Lists -4D Write Pro supports flat lists (single-level) and hierarchical lists (multi-level). +4D Write Pro supports flat lists (single-level) and multi-level lists. ### Single-level lists @@ -38,7 +38,7 @@ When the list is created using [the WP SET ATTRIBUTE command](../commands-legacy ### Multi-level lists -Multi-level lists are based on [hierarchical list style sheets](../user-legacy/stylesheets.md#hierarchical-list-style-sheets). Multi-level lists contain a root-level style sheet and one or more sub-level style sheet(s). Each level is attached to a hierarchical list style sheet and represents a depth in the list (level 1, level 2, level 3, etc.). +Multi-level lists are based on [multi-level list style sheets](../user-legacy/stylesheets.md#multi-level-list-style-sheets). Multi-level lists contain a root-level style sheet and one or more sub-level style sheet(s). Each level is attached to a multi-level list style sheet and represents a depth in the list (level 1, level 2, level 3, etc.). When a new sub-level is created, the level numbering restarts at 1. When you add or remove an element in your multi-level list, the numbers are automatically adjusted. @@ -54,30 +54,30 @@ Multi-level lists can be managed using: :::tip Related blog post -[4D Write Pro – Creating Multi-level Bullet or Numbered Lists Using Hierarchical list Style Sheets](https://blog.4d.com/4d-write-pro-creating-multi-level-bullet-or-numbered-lists-using-hierarchical-paragraph-style-sheets) +[4D Write Pro – Creating Multi-level Bullet or Numbered Lists Using Multi-level list Style Sheets](https://blog.4d.com/4d-write-pro-creating-multi-level-bullet-or-numbered-lists-using-multi-level-paragraph-style-sheets) ::: - + -## Hierarchical list style sheets +## Multi-level list style sheets -Hierarchical list style sheets are used to create [multi-level lists](../user-legacy/using-a-4d-write-pro-area.md#multi-level-lists). +Multi-level list style sheets are used to create [multi-level lists](../user-legacy/using-a-4d-write-pro-area.md#multi-level-lists). -To create a hierarchical list style sheet, use [WP New style sheet](../commands/wp-new-style-sheet.md) and pass in *listLevelCount* the desired number of levels. You then define a hierarchy of related paragraph style sheets: one **root-level** style sheet and one or more **sub-level** style sheets linked to it. Each level represents a depth in the list (level 1, level 2, level 3, etc.) and is automatically named "root-level name + lvl + index", for example "Mylist lvl 2". +To create a multi-level list style sheet, use [WP New style sheet](../commands/wp-new-style-sheet.md) and pass in *listLevelCount* the desired number of levels. You then define a hierarchy of related paragraph style sheets: one **root-level** style sheet and one or more **sub-level** style sheets linked to it. Each level represents a depth in the list (level 1, level 2, level 3, etc.) and is automatically named "root-level name + lvl + index", for example "Mylist lvl 2". -To customize hierarchical list styles, the paragraph style sheet object can be customized using [style sheet attributes](../commands-legacy/4d-write-pro-attributes.md#style-sheets). +To customize multi-level list styles, the paragraph style sheet object can be customized using [style sheet attributes](../commands-legacy/4d-write-pro-attributes.md#style-sheets). -Hierarchical list style sheets are fully supported by the following commands: [`WP Get style sheet`](../commands/wp-get-style-sheet.md), [`WP SET ATTRIBUTES`](../commands/wp-set-attributes.md), [`WP DELETE STYLE SHEET`](../commands/wp-delete-style-sheet.md). +Multi-level list style sheets are fully supported by the following commands: [`WP Get style sheet`](../commands/wp-get-style-sheet.md), [`WP SET ATTRIBUTES`](../commands/wp-set-attributes.md), [`WP DELETE STYLE SHEET`](../commands/wp-delete-style-sheet.md). ### Example -The following example creates a three-level hierarchical list style sheet and applies it to paragraphs. +The following example creates a three-level multi-level list style sheet and applies it to paragraphs. ```4d -// Create 3 hierarchical list style sheets +// Create 3 multi-level list style sheets WP New style sheet(wpArea; wk type paragraph; "MyList"; 3) // Retrieve each level @@ -91,7 +91,7 @@ WP SET ATTRIBUTES($level1; {listStyleType: wk upper latin; fontBold: wk true}) WP SET ATTRIBUTES($level2; {listConcatStringFormat: True}) WP SET ATTRIBUTES($level3; {listStringFormatLtr: "(#)"}) -// Apply hierarchical style sheets to paragraphs +// Apply multi-level style sheets to paragraphs var $paragraphs : Collection $paragraphs:=WP Get elements(wpArea; wk type paragraph) @@ -101,7 +101,7 @@ WP SET ATTRIBUTES($paragraphs[2]; wk style sheet; $level3) ``` result: -![](../../assets/en/WritePro/hierarchical-paragraph-stylesheets-1.png) +![](../../assets/en/WritePro/multi-level-paragraph-stylesheets-1.png) To delete the first sub-leve: @@ -110,11 +110,11 @@ WP DELETE STYLE SHEET(wpArea; "MyList"; 2) ``` result: -![](../../assets/en/WritePro/hierarchical-paragraph-stylesheets-2.png) +![](../../assets/en/WritePro/multi-level-paragraph-stylesheets-2.png) ### Predefined attribute values -When created, hierarchical list style sheets use predefined values: +When created, multi-level list style sheets use predefined values: * `wk margin left` = 0.75 cm \* (number of previous levels) or 0.25 inches \* (number of previous levels), depending on current layout unit * `wk list type` = `wk decimal` diff --git a/docs/WritePro/writeprointerface.md b/docs/WritePro/writeprointerface.md index 3d2ea53d183948..97deaa5801df9e 100644 --- a/docs/WritePro/writeprointerface.md +++ b/docs/WritePro/writeprointerface.md @@ -1,4 +1,4 @@ ---- +d--- id: writeprointerface title: 4D Write Pro Interface slug: /WritePro/write-pro-interface @@ -418,3 +418,155 @@ The History area lists all your prompts sent to the AI. You can hide/show this a The Erase button allows you to reset the whole window and erase all interactions. It is equivalent to close/reopen the AI dialog box. + +## Multi-level list style sheets + +4D Write Pro Interface allows users to create and manage [multi-level lists](./user-legacy/using-a-4d-write-pro-area.md#multi-level-lists) directly from both the toolbar and widget sidebar. + +**Toolbar:** + +![](../assets/en/WritePro/wp-multi-level-list-stylesheets1.png) + +**Sidebar:** + +![](../assets/en/WritePro/wp-multi-level-list-stylesheets2.png) + +To manage multi-level list style sheets, click the ![](../assets/en/WritePro/wp-multi-level-list-button.png) multi-level list button. + +When the multi-level list mode is enabled, the Style Sheets panel displays the [multi-level list style sheets](./user-legacy/stylesheets.md#multi-level-list-style-sheets) defined in the document as well as [predefined templates](#predefined-templates). + +![](../assets/en/WritePro/wp-multi-level-list-panel.png) + +### Managing multi-level style sheets + +The Style Sheets panel allows you in general to: + +* ![](../assets/en/WritePro/wp-multi-level-list-button1.png) Create a new style sheet. +* ![](../assets/en/WritePro/wp-multi-level-list-button2.png) Delete a style sheet. +* ![](../assets/en/WritePro/wp-multi-level-list-button3.png) Update a style sheet. + +Once a multi-level list style sheet is selected, the panel provides also tools to manage the hierarchy and numbering of the list: + +* ![](../assets/en/WritePro/wp-multi-level-list-button4.png) Increase the list level of selected paragraphs. +* ![](../assets/en/WritePro/wp-multi-level-list-button5.png) Decrease the list level of selected paragraphs. +* ![](../assets/en/WritePro/wp-multi-level-list-button6.png) Append a level to the list and create a new sub-level. +* ![](../assets/en/WritePro/wp-multi-level-list7.png) Modify numbering formats. +* ![](../assets/en/WritePro/wp-multi-level-list-button8.png) Concatenate numbering markers between levels. + +### Creating a style sheet + +To create a multi-level list style sheet you can either: + +* Select and apply one of the predefined templates to the paragraph(s), the selected template and all it sub-levels are then displayed on the top part of the sytle sheets panel. You can customize its levels and formatting (such as numbering styles, colors, fonts, or hierarchy), and then create a new style sheet based on the resulting selection. + +* Duplicate one of the existing style sheets via the Duplicate option in the ![](../assets/en/WritePro/wp-multi-level-list-button1.png) bottom menu. + +* Click the ![](../assets/en/WritePro/wp-multi-level-list-button1.png) button and then "New style sheet based on selection" after having selected paragraph(s) to use for the style sheet according to the following: + * If the selected paragraph(s) use(s) a list marker, a new multi-level list style sheet made of one level is created based on the current formatting. + * If the selected paragraph(s) already use(s) a root-level or a sub-level of a multi-level list style sheet, the complete hierarchy is duplicated. + +:::note + +For detailed information about creating and configuring multi-level list style sheets by programming, see [Multi-level list style sheets](./user-legacy/stylesheets.md#multi-level-list-style-sheets). + +::: + +### Applying a multi-level list + +You can apply either a multi-level list style sheet defined in the document or one of the predefined templates to the selected paragraphs using the Style Sheets panel: + +![](../assets/en/WritePro/wp-multi-level-list-panel2.png) + + +### Predefined templates + +The interface provides the following predefined multi-level list templates: + +**Technical Blueprint** + +Level 1: 1 +Level 2: 1.1 +Level 3: 1.1.1 +Level 4: 1.1.1.1 +Level 5: 1.1.1.1.1 + +**Legal & Governance** + +Level 1: I. +Level 2: A. +Level 3: 1. +Level 4: a) +Level 5: (1) +Level 6: (a) +Level 7: (i) + +**Educational Material** + +Level 1: I. +Level 2: 1. +Level 3: 1.1. +Level 4: a. +Level 5: ● + +**Meeting Minutes** + +Level 1: 1. +Level 2: ● + +**Visual Hierarchy** + +Level 1: ♣ (Club) +Level 2: ♦ (Diamond) +Level 3: ■ (Square) +Level 4: □ (Hollow Square) +Level 5: ● (Disc) +Level 6: ○ (Circle) +Level 7: – (Dash) + +### Customizing predefined templates + +You can customize the available templates to provide users with predefined multi-level lists that match the needs of your application. + +The predefined multi-level list templates are defined in a JSON file named `multiLevelStyles.json`. This file is located in the 4D Write Pro Interface component Resources folder. + +You can customize the available templates by adding your own `multiLevelStyles.json` file in either: + +* the project's local Resources folder directly, +* a `4D WritePro Interface` folder located within the project Resources folder. + +If a `multiLevelStyles.json` file is present in both locations, the file located in the `4D WritePro Interface` folder takes precedence. + +Each template definition includes: + +* a template name, +* one or more list levels, +* the 4D Write Pro attributes applied to each level. Any 4D Write Pro attribute can be used in a template definition. + +You can use either the attribute names or the corresponding 4D Write Pro constants as JSON keys and values. +For example, the following definitions are equivalent: + +* `"listStyleType": "wk upper roman"` +* `"wk list style type": "wk upper roman"` + +#### Example + +Example of a customized JSON file: + +```json +{ + "predefinedMultiLevelLists": [ + { + "name": "Technical Blue Print Updated", + "levels": [ + { "listStyleType": "wk decimal" }, + { "listStyleType": "wk decimal", "listConcatStringFormat": true } + ] + } + ] +} +``` + +### See also +* [Related blog post: Multi-Level Style Sheets in 4D Write Pro: Now With a Dedicated UI](https://blog.4d.com/multi-level-style-sheets-in-4d-write-pro-now-with-a-dedicated-ui) +* [multi-level list style sheets](./user-legacy/stylesheets.md#multi-level-list-style-sheets) +* [multi-level lists](.user-legacy/using-a-4d-write-pro-area.md#multi-level-lists) \ No newline at end of file diff --git a/docs/assets/en/WritePro/wp-multi-level-list-button.png b/docs/assets/en/WritePro/wp-multi-level-list-button.png new file mode 100644 index 00000000000000..5f8e7ee323f616 Binary files /dev/null and b/docs/assets/en/WritePro/wp-multi-level-list-button.png differ diff --git a/docs/assets/en/WritePro/wp-multi-level-list-button1.png b/docs/assets/en/WritePro/wp-multi-level-list-button1.png new file mode 100644 index 00000000000000..07da3e87098960 Binary files /dev/null and b/docs/assets/en/WritePro/wp-multi-level-list-button1.png differ diff --git a/docs/assets/en/WritePro/wp-multi-level-list-button2.png b/docs/assets/en/WritePro/wp-multi-level-list-button2.png new file mode 100644 index 00000000000000..088e4c64ed531e Binary files /dev/null and b/docs/assets/en/WritePro/wp-multi-level-list-button2.png differ diff --git a/docs/assets/en/WritePro/wp-multi-level-list-button3.png b/docs/assets/en/WritePro/wp-multi-level-list-button3.png new file mode 100644 index 00000000000000..ddda09768ac90f Binary files /dev/null and b/docs/assets/en/WritePro/wp-multi-level-list-button3.png differ diff --git a/docs/assets/en/WritePro/wp-multi-level-list-button4.png b/docs/assets/en/WritePro/wp-multi-level-list-button4.png new file mode 100644 index 00000000000000..aadcadc4745659 Binary files /dev/null and b/docs/assets/en/WritePro/wp-multi-level-list-button4.png differ diff --git a/docs/assets/en/WritePro/wp-multi-level-list-button5.png b/docs/assets/en/WritePro/wp-multi-level-list-button5.png new file mode 100644 index 00000000000000..7de845916f4a1f Binary files /dev/null and b/docs/assets/en/WritePro/wp-multi-level-list-button5.png differ diff --git a/docs/assets/en/WritePro/wp-multi-level-list-button6.png b/docs/assets/en/WritePro/wp-multi-level-list-button6.png new file mode 100644 index 00000000000000..636cb5780823cd Binary files /dev/null and b/docs/assets/en/WritePro/wp-multi-level-list-button6.png differ diff --git a/docs/assets/en/WritePro/wp-multi-level-list-button8.png b/docs/assets/en/WritePro/wp-multi-level-list-button8.png new file mode 100644 index 00000000000000..0d5031837e8773 Binary files /dev/null and b/docs/assets/en/WritePro/wp-multi-level-list-button8.png differ diff --git a/docs/assets/en/WritePro/wp-multi-level-list-panel.png b/docs/assets/en/WritePro/wp-multi-level-list-panel.png new file mode 100644 index 00000000000000..652d71520d5fe7 Binary files /dev/null and b/docs/assets/en/WritePro/wp-multi-level-list-panel.png differ diff --git a/docs/assets/en/WritePro/wp-multi-level-list-panel2.png b/docs/assets/en/WritePro/wp-multi-level-list-panel2.png new file mode 100644 index 00000000000000..6e3c56f16b0d7a Binary files /dev/null and b/docs/assets/en/WritePro/wp-multi-level-list-panel2.png differ diff --git a/docs/assets/en/WritePro/wp-multi-level-list-stylesheets1.png b/docs/assets/en/WritePro/wp-multi-level-list-stylesheets1.png new file mode 100644 index 00000000000000..10c1d6e47429a9 Binary files /dev/null and b/docs/assets/en/WritePro/wp-multi-level-list-stylesheets1.png differ diff --git a/docs/assets/en/WritePro/wp-multi-level-list-stylesheets2.png b/docs/assets/en/WritePro/wp-multi-level-list-stylesheets2.png new file mode 100644 index 00000000000000..a0d750f5bd4f62 Binary files /dev/null and b/docs/assets/en/WritePro/wp-multi-level-list-stylesheets2.png differ diff --git a/docs/assets/en/WritePro/wp-multi-level-list7.png b/docs/assets/en/WritePro/wp-multi-level-list7.png new file mode 100644 index 00000000000000..646a3d751ced01 Binary files /dev/null and b/docs/assets/en/WritePro/wp-multi-level-list7.png differ